SyncEnd Event

Microsoft Outlook Visual Basic

SyncEnd Event

       

Occurs immediately after Microsoft Outlook finishes synchronizing a user’s folders using the specified synchronization profile. This event is not available in VBScript.

Sub object_SyncEnd()

object   An expression that evaluates to a SyncObject object.

Example

This example updates a label on a form to indicate that synchronization has finished and changes the enabled state of buttons on the form. 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
Dim WithEvents mySync As Outlook.SyncObject
Dim myForm As New Form1

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

Private Sub mySync_SyncEnd()
    Form1.Label1.Caption = "Synchronization complete."
    Form1.Command1.Enabled = True
    Form1.Command2.Enabled = False
End Sub