none
Set custom folder as default inbox programmatically RRS feed

  • Question

  • Hi All,

    I was wondering if I can set up a custom folder as the default inbox for a custom PST store (not the default store) through an add-in. Just to be clear, I want to set a custom, already created folder to be the default folder, NOT to setup the default folder structure under my PST.

    I am creating the add-in as a com add-in using VS2010 and C# targeting Outlook 2003. The PST is not the recipient for any account, all items added to the folders are generated programmatically.

    I was also wondering: in the case that you CAN set up the default folder, can you set two custom folders as default inbox? (kind of a silly question, but I want to be absolutely certain)

    Thanks,

    Thimila

    Tuesday, March 5, 2013 10:58 PM

Answers

  • The desktop alert (aka Toaster) is only shown when a transport provider notifies the MAPi system that it delivered a new message. I am pretty sure it only works for the messages in the default store in the profile.

    There is also a special flag that can be used when saving a message that notifies the store provider/MAPI that the new message must be passed through the rules engine - search for the ITEMPPROC_FORCE and NON_EMS_XP_SAVE on MSDN. You can make Redemption use these flags if you call RDOMail.SaveAs and pass an empty file name - in that case Redemption assumes that what you really want is call IMessage::SaveChanges() using teh flags passed as the second parameter.


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

    Friday, March 8, 2013 5:23 PM
  • No, that feature was added in version 5.4,

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

    Thursday, March 14, 2013 3:35 AM
  • No, it is either Extended MAPI or Redemption.

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

    Thursday, March 14, 2013 4:44 AM

All replies

  • How exactly would those folders be used? Outlook only cares about the inbox if the default store.

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

    Wednesday, March 6, 2013 1:17 PM
  • Hi Dmitry,

    The folders will contain only mail items that are created through Redemption. User will not be replying/forwarding the mails using Outlook.

    What I really need to do is to display the default outlook new mail desktop alert for items created programmatically into a custom folder. I thought that this may be possible if I set that folder as a default inbox, but I am skeptic now.

    Is there a way to forcefully prompt the desktop alert for a created mail on another folder than the default store inbox? Or is creating my own alert the best way?

    Wednesday, March 6, 2013 11:22 PM
  • The desktop alert (aka Toaster) is only shown when a transport provider notifies the MAPi system that it delivered a new message. I am pretty sure it only works for the messages in the default store in the profile.

    There is also a special flag that can be used when saving a message that notifies the store provider/MAPI that the new message must be passed through the rules engine - search for the ITEMPPROC_FORCE and NON_EMS_XP_SAVE on MSDN. You can make Redemption use these flags if you call RDOMail.SaveAs and pass an empty file name - in that case Redemption assumes that what you really want is call IMessage::SaveChanges() using teh flags passed as the second parameter.


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

    Friday, March 8, 2013 5:23 PM
  • Does Redemption SaveAs() support this on version 4.5? I tried it and got an error. Perhaps my code is also wrong. I called it as:

    public const int ITEMPROC_FORCE = 0x00000800;
    public const int NON_EMS_XP_SAVE = 0x00001000;
    
    rdoMailItem.SaveAs("", ITEMPROC_FORCE+NON_EMS_XP_SAVE);


    Thursday, March 14, 2013 3:08 AM
  • No, that feature was added in version 5.4,

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

    Thursday, March 14, 2013 3:35 AM
  • Oh, ok.

    Can I use the Microsoft.Office.Interop.Outlook.MailItem to set these flags? I cannot find a SaveChanges method on it, it does have a SaveAs method receiving the same parameters as the Redemption(4.5) SaveAs method.

    oomMail.SaveAs("", ITEMPROC_FORCE+NON_EMS_XP_SAVE);
    Thursday, March 14, 2013 4:39 AM
  • No, it is either Extended MAPI or Redemption.

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

    Thursday, March 14, 2013 4:44 AM