none
Under what condition email will not have PR_SEARCH_KEY? RRS feed

  • Question

  • Hi,

    I have a client reporting to me that PR_SEARCH_KEY is missing in some emails.

    I did some research on it but could not get much from it.

    When will an email will not have PR_SEARCH_KEY?

    Thanks


    thopulou Associate Software Engineer

    Wednesday, May 9, 2018 1:28 PM

All replies

  • Was the message saved? What kind of message store is it (online/cached Exchange, PST, IMAP4, etc.)?

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

    Wednesday, May 9, 2018 2:53 PM
  • Hello,

    The client is responsible for setting up that property (store provider) when then message is added to the store, i.e. saved. Does your client use a custom store provider?

    The PR_SEARCH_KEY property may be available even before the Save method is called for messages. For others types of objects, it depends on the provider implementation. 

    You may find the PR_SEARCH_KEY and Draft Messages post helpful.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, May 10, 2018 12:34 AM
  • PR_SEARCH_KEY is added automatically by the store provider as soon as a message is created, a client is not involved at all. It is available on other objects (eg. IMailUser etc.) after the object is saved or earlier, it is up to the provider.

    See https://msdn.microsoft.com/en-us/library/office/cc815908.aspx?f=255&MSPPError=-2147217396


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

    Thursday, May 10, 2018 12:51 AM
  • A client is Outlook (a store provider). Looks like I wasn't clear enough.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, May 10, 2018 12:54 AM
  • Well, Outlook is the client, but the store provider is separate - it is in emsmdb32.dll, which is a standalone MAPI provider (in theory) independent from Outlook itself. :-)

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

    Thursday, May 10, 2018 2:41 AM
  • Okay, if we call Exchange as a server, then how should we name a store provider with Outlook? :-)

    In terms of Extended MAPI I agree with you.But if we look at the client/server side the picture is a bit different.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, May 10, 2018 3:11 AM
  • Hi Dmitry,

    I will have to check with Customer what kind of message store they are using.

    when the message is saved irrespective whether it is in cached or online mode it has PR_SEARCH_KEY.

    so under what condition a message store will not create PR_SEARCH_KEY for a message?

    Thanks


    thopulou Associate Software Engineer

    Thursday, May 10, 2018 10:44 AM
  • Hi Eugene,

    Thanks for the post you shared.

    I will some collect some more information from my client what kind of store they are using.

    Thanks


    thopulou Associate Software Engineer

    Thursday, May 10, 2018 10:48 AM
  • I can only imagine a buggy third party MAPI store provider. All Microsoft stores certainly make that property available as soon as a message is created.

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

    Thursday, May 10, 2018 2:26 PM
  • Dmitry,

    Can you please list a few of them in case you have ever met some?

    It would be great to know (and me as well) for troubleshooting purposes. 


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, May 10, 2018 2:52 PM
  • There is one from Google, as well as quite a few built on top of MSPST provider used internally by some large companies.

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

    Thursday, May 10, 2018 3:21 PM
  • Dmitry,

    I am aware of Google. Could you please name others to be aware of?


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, May 10, 2018 3:51 PM