none
StorageItem.Save problem RRS feed

  • Question

  • Hi, I'm using VS 2010 for developing our Outlook plugin. I'm experiencing a problem with StorageItem in Outlook 2007.

    Simple code for tests

    Outlook.MAPIFolder folder = ThisAddIn.oPlugin.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
    Outlook.StorageItem sg = folder.GetStorage("QI.Test", Outlook.OlStorageIdentifierType.olIdentifyBySubject);
    if (sg.Size == 0)
    {
      sg.UserProperties.Add("something", Outlook.OlUserPropertyType.olText);
    }
    sg.UserProperties["something"].Value = "ahoj";
    sg.Save();

    Outlook 2007: Everytime I run this function, StorageItem size is 0.
    Outlook 2010: Works as expected.

    Edit: I've noticed that when I try to create/get storageitem in folder returned by GetDefaultFolder with type Outlook.OlDefaultFolders.oFolderInbox, it works. Any idea why it doesn't work with Outlook.OlDefaultFolders.olFolderCalendar?

    Thanks. Michal

    Friday, June 8, 2012 8:30 AM

Answers

  • i think there was an error related to this on vanilla 2007 outlook - are you sure you have latest sp3 installed there?
    • Marked as answer by Wocko Monday, June 11, 2012 7:56 AM
    Saturday, June 9, 2012 5:09 AM

All replies

  • i think there was an error related to this on vanilla 2007 outlook - are you sure you have latest sp3 installed there?
    • Marked as answer by Wocko Monday, June 11, 2012 7:56 AM
    Saturday, June 9, 2012 5:09 AM
  • You were right, it needs at least SP1 to work properly. Thanks.
    Monday, June 11, 2012 7:55 AM