Progress Event

Microsoft Outlook Visual Basic

Occurs periodically while Microsoft Outlook is synchronizing a user’s folders using the specified Send\Receive group. This event is not available in Microsoft Visual Basic Scripting Edition (VBScript).

Sub object_Progress(ByVal State As OlSyncState, ByVal Description As String, ByVal Value As Long, ByVal Max As Long)

object    An expression that evaluates to a SyncObject object.

State    Required. A value that identifies the current state of the synchronization process. Can be either of the following OlSyncState constants: olSyncStarted or olSyncStopped.

Description    Required. A textual description of the current state of the synchronization process.

Value    Required. Specifies the current value of the synchronization process (such as the number of items synchronized).

Max Required. The maximum that Value   can reach. The ratio of Value   to Max   represents the percent complete of the synchronization process.

Example

This Microsoft Visual Basic/Visual Basic for Applications (VBA) example shows the progress of synchronization. The sample code must be placed in a class module, and the Initialize_handler routine must be called before the event procedure can be called by Microsoft Outlook.

Dim myOlApp As New Outlook.Application
Public WithEvents mySync As Outlook.SyncObject

Sub Initialize_handler()
 Set mySync = myOlApp.Session.SyncObjects.Item(1)
 mySync.Start
End Sub

Private Sub mySync_Progress(ByVal State As Outlook.OlSyncState, ByVal Description As String, ByVal Value As Long, ByVal Max As Long)
 If Not Description = "" Then
  MsgBox Description
 End If
End Sub