Outllook user propeties are not set properly in outlook 2007 and IMAP configuaration RRS feed

  • Question

  • Hi,

    I am working on add-in. After particular task I am setting User property in following way.

    1) CComPtr<Outlook::UserProperties> spUserProperties;
            HRESULT hr = pMail->get_UserProperties(&spUserProperties);

       CComPtr<Outlook::UserProperty> spProp;

        hr = spUserProperties->Add(CComBSTR(csPropertyName), Outlook::olText, CComVariant(false),
                CComVariant((long)0), &spProp);

       HResult is always S_OK , SPProp is also correct . But when I recheck it whether property is set or Not. I get property as NULL.

      This scenerio is happened only in case of Outlook2007 and IMAP configuration.

    2) When outllook 2007 is configured with IMAP. It gives multiple OnNewItemEvent() notification for same mail

    Thanks in advance.

    • Edited by NehaG Wednesday, January 6, 2016 11:04 AM
    Wednesday, January 6, 2016 11:00 AM

All replies

  • Hello Neha,

    First of all, make sure you have all the latest updates and service packs installed for Outlook 2007. 

    Did you try to call the Save method after setting the property? Does it help?

    Where did you get the OnNewItemEvent event? I don't see such events in the OOM.

    Wednesday, January 6, 2016 11:35 AM
  • 1) I tried with save method. But it doesn't work. It works all other configuration except outlook2007and IMAP

    2) Sorry, It onnewmailEx() event which get called multiple times

    • Edited by NehaG Thursday, January 7, 2016 5:24 AM
    Thursday, January 7, 2016 5:24 AM