none
Outlook StorageItem Roaming RRS feed

  • Question

  • I am working on an Outlook VSTO add-in where I am trying to have some XML values follow a user between different machines.

    I am using StorageItem to save the data, however, if I make changes to the XML, save the data (via the addin), shutdown Outlook, log into another computer, launch Outlook (as the same user) and retrieve the data via the same addin, the changes are not always updated. Sometimes the latest changes appears immediately, sometimes it appears after a few minutes and sometimes never.

    I am reading the data on startup (using GetStorage), and saving the data on when user performs an action. I am developing the add-in using .Net 4.5 on Visual Studio 2012 for Outlook 2010/2013.

    I would appreciate any help on this issue.
    TIA
    Vikram

    Friday, March 20, 2015 7:18 PM

Answers

  • Jens,

    Thank you very for your reply.

    I modified my code to release the handle to the folder and storageitem after I the save data to the storage item. If I shutdown Outlook and log into another machine and read the storageitem after startup (Eg: When the user clicks on a custom button in the ribbon), the data seems to get synchronized consistently. I think this solution will work for us now since we do not need the data to be synchronized at startup.

    Vikram

    Tuesday, March 24, 2015 6:04 PM

All replies

  • Are you working with a cached Exchange mailbox? It gets synchronized whenever Outlook feels like it, and even if you start sync explicitly, it is still asynchronous.

    There is nothing you can do unless you delay load the storage item giving Outlook a chance to synchronize.

    You can also try to always work with the item on the server, but you would need to use Extended MAPI (C++ or Delphi only) or Redemption (any language).


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, March 20, 2015 8:10 PM
  • Dimitry, thanks for your response. We are using a cached Exchange mailbox.

    If I wanted to delay the load of storage item, can I find out when Outlook is done synchronizing?

    Friday, March 20, 2015 8:59 PM
  • No, Exchange continuously syncs the cached store. What kind of options do you store? At what point do you absolutely need to have them?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, March 20, 2015 11:05 PM
  • Also, if you are using Extended MAPI or Redemption, it is possible to sink events from the associated (hidden) message represented by the StorageItem in the Outlook Object Model.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, March 20, 2015 11:48 PM
  • Dimitry, we are storing custom application related properties. We access them on startup, but I think we can delay it for a few minutes.

    I think we would be OK with a delay in the synchronization as long as we could predictably say how long it would take for the data to synchronize.

    Thanks once again for your help.
    Vikram

    Saturday, March 21, 2015 9:21 PM
  • Right now we are not using Extended MAPI or Redemption.
    Saturday, March 21, 2015 9:22 PM
  • You cannot reliably predict it, but a delay of a few minutes should be enough.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Saturday, March 21, 2015 9:44 PM
  • Please note that synchronization is a 2-way process. Outlook also needs time to up-sync the changes from the first Mailbox to the server. If you log out of the machine too fast or shut down Outlook on the first machine before the synchronization is finished, you will wait forever for the second machine to catch up and your storage item will not appear. So, the solution would be to deactivate cached mode or work directly with the server API as Dmitry suggested, if you rely on an updated storage item as soon as the other outllok instance connects to the server and down-sync's the changes.

    - Jens
    http://blogs.msdn.com/b/jensha/


    Jens Häupel [MSFT]

    Tuesday, March 24, 2015 3:24 PM
  • Jens,

    Thank you very for your reply.

    I modified my code to release the handle to the folder and storageitem after I the save data to the storage item. If I shutdown Outlook and log into another machine and read the storageitem after startup (Eg: When the user clicks on a custom button in the ribbon), the data seems to get synchronized consistently. I think this solution will work for us now since we do not need the data to be synchronized at startup.

    Vikram

    Tuesday, March 24, 2015 6:04 PM
  • That is good to know. Please the post that answered your question as the answer.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, March 24, 2015 7:49 PM