none
How to know when outlook has finished downloading items in exchange cached mode RRS feed

  • Question

  • Hello,

     

    I'm writing an addin for outlook 2007/2010 using VSTO 3.5. During the startup, I need to do process some folders, but before doing that, I need to make sure that if using an exchange account, everything is in sync with the server (in case the user changed something on another client, for instance).

     

    I can use outlook sync objects, and in my case, I'm using the redemption folder synchronizer (which is the same thing). The problem is in exchange cached mode.

    To be able to sync when using cached mode, I had to use the MAPI_NO_CACHE flag to open a folder. With that, it synchronizes correctly. However, the items does not immediately appear in the cache (so they are not available in outlook immediately). So after the sync is done, I have to wait for a few seconds while outlook downloads the items so that they appear in the client. In the meanwhile, if I try to do anything with the items I synced in the code, an error will appear,  stating that "One or more items in the folder you synchronized do not match. To resolve the conflicts, open the items, and then try this operation again."

     

    I've tried using SyncObjects[1].Start() and moving my code to the SyncEnd event, I have also tried calling SendReceive after the synchronization is done. None worked. The items are synced correctly with the server, but the exchange cache on the client is not updated correctly.

    The only way I have found around this is to open every folder I want to use with MAPI_NO_CACHE flag, to simulate working in online mode. But this is a real bundle, as the work done on startup is huge, and I don't want to end up rewriting everything.

    Is there any event to check if the cached client is up to date?

    Thank you

     

    Tuesday, May 24, 2011 10:56 AM

Answers

  • There's no way I know of to do that.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "CharbelA86" <=?utf-8?B?Q2hhcmJlbEE4Ng==?=> wrote in message news:950450a9-0cce-4ed5-9b67-91f5f81676ff...

    Hello,

     

    I'm writing an addin for outlook 2007/2010 using VSTO 3.5. During the startup, I need to do process some folders, but before doing that, I need to make sure that if using an exchange account, everything is in sync with the server (in case the user changed something on another client, for instance).

     

    I can use outlook sync objects, and in my case, I'm using the redemption folder synchronizer (which is the same thing). The problem is in exchange cached mode.

    To be able to sync when using cached mode, I had to use the MAPI_NO_CACHE flag to open a folder. With that, it synchronizes correctly. However, the items does not immediately appear in the cache (so they are not available in outlook immediately). So after the sync is done, I have to wait for a few seconds while outlook downloads the items so that they appear in the client. In the meanwhile, if I try to do anything with the items I synced in the code, an error will appear,  stating that "One or more items in the folder you synchronized do not match. To resolve the conflicts, open the items, and then try this operation again."

     

    I've tried using SyncObjects[1].Start() and moving my code to the SyncEnd event, I have also tried calling SendReceive after the synchronization is done. None worked. The items are synced correctly with the server, but the exchange cache on the client is not updated correctly.

    The only way I have found around this is to open every folder I want to use with MAPI_NO_CACHE flag, to simulate working in online mode. But this is a real bundle, as the work done on startup is huge, and I don't want to end up rewriting everything.

    Is there any event to check if the cached client is up to date?

    Thank you

     


    Ken Slovak MVP - Outlook
    Tuesday, May 24, 2011 1:33 PM