IMAPISession::SetDefaultStore fails RRS feed

  • Question

  • Hi everyone,

    I have added gmail account in Microsoft Outlook using the settings from There are 2 message stores displayed in MFCMAPI. First is '' and second is 'Outlook Data File' which is the default store. Setting '' store as default message store fails for every flag. Same is the result with ymail account also. Kindly provide explanation why IMAPISession::SetDefaultStore is failing? Is there something wrong with MAPI subsystem? 

    Thanks & regards,

    Talib Hussain
    • Edited by talib2608 Thursday, June 12, 2014 10:34 AM
    Thursday, June 12, 2014 10:32 AM


All replies

  • Hello Talib,

    > There are 2 message stores displayed in MFCMAPI.

    This is a fairly typical question from Outlook users who are new to IMAP accounts. Please take a look at the What you need to know about IMAP accounts in Outlook 2013 and Configure and Use IMAP Accounts pages.

    The SetDefaultStore method has the following description in MSDN:

    To establish a message store as the default, the message store must have the following flags set in its PR_STORE_SUPPORT_MASK (PidTagStoreSupportMask) property:           





    Thursday, June 12, 2014 11:03 AM
  • Hi Eugene,

    I didn't get by what you said about fairly typical question? Could you be more clear?

    And PR_STORE_SUPPORT_MASK condition also qualifies as given in

    And I am using Outlook 2010.

    If we can set the Public Folder Message Store as default store when the account is connected to Exchange, then in this case also there shouldn't be any problem.

    Thursday, June 12, 2014 1:18 PM
  • What is the error code returned by IMAPISession::SetDefaultStore?

    Can you set that store as default through the Outlook UI (File | Info | Account Settings)?

    Dmitry Streblechenko (MVP)
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Thursday, June 12, 2014 1:22 PM
  • Hi Dmitry,

    Even you can try this.

    Below is the snapshot of MFCMAPI

    The 'Set as Default' is disabled in 'Data Files' tab in the Outlook.

    Thursday, June 12, 2014 1:47 PM
  • Did you try to set the default store through the Outlook UI as Dmitry suggested? Do you get any errors?
    Thursday, June 12, 2014 2:06 PM
  • Hi Eugene,

    Even you can configure gmail account in Outlook. I have already replied to Dmitry with the answer.

    Friday, June 13, 2014 4:08 AM
  • > The 'Set as Default' is disabled in 'Data Files' tab in the Outlook.

    It confirms the fact that such operation is not supported. There is nothing strange in that case.

    Friday, June 13, 2014 10:16 AM
  • Hi Eugene,

    Thanks. I was going according to documentation, and no such explanation is given in it. Maybe that's why I was having a doubt.

    • Edited by talib2608 Friday, June 13, 2014 11:08 AM
    Friday, June 13, 2014 11:05 AM