Outlook object model and SyncObjects

P

Petr Jarkovsky

Hi,

I have the problem with Outlook object model and SyncObjects.
When I use something like OutApp.Session.SyncObjects.Item(1).Start, it works
fine, but I need to catch events OnSyncStart, OnSyncEnd, OnProgress and
OnError. So, I wrote my own class (in Delphi, inherited from TOleServer) for
connecting to SyncObject and listening for these events.

When I connect to any SyncObject (e.g. OutApp.Session.SyncObjects.Item(1)),
the calling Start method of this object raise an exception with message:
'Cann't get synchronization objects in Outlook application. This problem is
obviously caused by the wrong configuration of Outlook application for
offline mode.' (translated to English).

I used some examples from MSDN and other web sites, I used even original
example code from Borland, but I still get the same error.

Can someone help me?

Petr Jarkovsky
 
P

Petr Jarkovsky

I found a solution of this problem.
I must hold an active Explorer object in memory. Just only in some variable.
Then I can use SyncObjects without raising the exception.

e.g.:
in initialization section:
inbox := OutlookApp.Outlook.Session.GetDefaultFolder(olFolderInbox);
explorer := inbox.GetExplorer(EmptyParam);

in finalization section:
explorer.Close;
explorer := nil;
inbox := nil;

Petr Jarkovsky
 

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