none
Getting Store Mapi property tag via property accessor RRS feed

  • Question

  • Can someone let me know if the MAPI property tag's hexa decimal value changes between outlook versions. ( Iam using known folders like inbox, sent items etc so i guess it shouldnt).

    Also is there any difference in getting the entry id of a folder from the getdefaultfolder method and using the propertyaccessor ?

    for ex in the below vb script,

    Store.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x35E40102") //convert the returned byte array to string

    vs

    Store.GetDefaultFolder(olFolderSentMail).entryID //string

    is there any difference ?



    • Edited by Noviez Tuesday, January 7, 2014 1:04 AM
    Tuesday, January 7, 2014 1:04 AM

All replies

  • This is not a named property, PR_IPM_SENTMAIL_ENTRYID stays the same.

    There is no difference, PropertyAccessor might be a bit faster.


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

    Tuesday, January 7, 2014 1:14 AM
  • I would stay with GetDefaultFolder if I were you - your code is easier to read, please you are not relying on the low level details (PR_IPM_SENTMAIL_ENTRYID). For IMAP4 stores, that property might not be set - it is actually stored in the account properties in the profile section.


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

    Tuesday, January 7, 2014 2:53 AM
  • Hello Noviez,

    Please take a look at the MAPI Property Tags page in MSDN. It states: MAPI defines a set of property tag constants for its properties in the Mapitags.h header file; these properties are referred to as the "MAPI-defined properties" and they don't change their IDs. Only Named properties may change IDs from PC to PC.

    There is no difference in using the Store.GetDefaultFolder and PropertyAccessor.GetProperty classes and their properties. Both of them were introduced with Outlook 2007. So, they will not work for earlier Outlook versions.

    Tuesday, January 7, 2014 9:32 AM
  • Hi Dimitry,

    Iam trying to work around a bug in the Outlook with the new sp2 update, where if I invoke (as i do currently) Store.GetDefaultFolder(olFolderOutbox) & Store.GetDefaultFolder(olFolderSentMail) on a offline Outlook data file it creates random ghost folders instead of erroring out.

    I kind of reported it sometime back but strangely it doesnt seem to happen for few (consistently happens for multiple machines here). http://social.msdn.microsoft.com/Forums/en-US/38f27249-ffe6-4be4-b894-b164aa804eba/ghost-folders-created-on-message-stores-with-no-mail-accounts-associated?forum=outlookdev

    Can you give some more details on the IMAP4 scenario? I checked with my IMAP account and the query returned expected results.

    Wednesday, January 8, 2014 8:35 PM
  • I have seen cases where PR_IPM_SENTMAIL_ENTRYID property was not set on the IMAP4 stores. I don't know how often that happens, but I did have to work around that previously.

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

    Wednesday, January 8, 2014 8:49 PM