SyncObjects Property Example

This Microsoft Visual Basic/Visual Basic for Applications example starts synchronization of the user’s second synchronization profile in response to the user clicking a button on a form.

Private Sub Command1_Click()
    Dim myOlApp As New Outlook.Application
    Dim mySyncs As Outlook.SyncObjects
    Set mySyncs = myOlApp.GetNamespace("MAPI").SyncObjects
    Set mySyncObj = mySyncs.Item(2)
    mySyncObj.Start
End Sub