"Outlook failed to get the Sync Objects" error Visual Basic.NET

A

Ad the Lad

This message occurs when you instantiatiate the Outlook SyncObjects
object:

See below for example:

Dim outapp As Outlook.Application
Dim olns As Outlook.NameSpace
Dim objSyncs As Outlook.SyncObjects

' Start Outlook application
outapp = New Outlook.Application

'Initialise Namespace
olns = outapp.GetNamespace("MAPI")

'Create Syncobjects
objSyncs = olns.SyncObjects

The error is as follows:

"Outlook failed to get the Sync Objects. This is probably because
Outlook is not properly configured for offline mode."

Annoyingly, there is nothing on Microsoft's website about this issue.

Thanks to another contributor to this group, I now appear to have
solved this problem.

The answer is as follows:

You need to open the explorer object of the inbox before creating the
Syncobjects object as follows:

' Bug Fix
olns.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox).GetExplorer()

'Create Syncobjects
objSyncs = olns.SyncObjects

Hope you find this useful
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top