views:

245

answers:

0

I am using Delphi 6 with DevExpress cxScheduler components to sync tasks and events in our application with Outlook... When Outlook is open, and an existing event or task is updated in Outlook - our app does not see the new changes until Outlook is closed - so if we run the sync process without closing Outlook, our app overwrites the changes made in Outlook because the outlook field called "LastModifiedTime" on the event still reflects the original date (Outlook changes are begin cached in memory). If we update an event in Outlook - then close Outlook BEFORE running the sync process - everyting is fine. We are using ole automation to create outlook objects in the app - is there a way with the ole outlook application object to get the latest changes (flush the cache). I could force the Outlook app to close before the sync operation which would probably fix the issues but not the best fix. Does anyone have any suggestions? The following code is being used to create the Outlook application ole object:

  try
    OLApp    := GetActiveOleObject(scxOutlookApp) as _Application;
  except
    try
      OLApp  := CreateOleObject(scxOutlookApp) as _Application;
      Result := True;
    except
      on e:Exception do
        ShowMessage('Cannot Load Outlook:'+e.message);
    end;
  end;