none
Existing e-mail RRS feed

  • Question

  • In programming an Outlook Add-on, for a new mail message, the type should be Outlook.MailItem.
    Can somebody tell me what type should be used for an existing mail message?

    Monday, October 27, 2014 2:56 PM

Answers

  • Hello Lucian,

    The incoming Outlook item can also be a meeting request and etc., not only a mail item. The MessageClass property is used for identifying the type of message.

    > Can somebody tell me what type should be used for an existing mail message?

    You can't be sure that you will receive only MailItem object. That's why I'd suggest using the "is" or "as" operator in C#.

    What exactly are you going to implement? Could you please describe your final goal?

    Monday, October 27, 2014 4:06 PM

All replies

  • Hello Lucian,

    The incoming Outlook item can also be a meeting request and etc., not only a mail item. The MessageClass property is used for identifying the type of message.

    > Can somebody tell me what type should be used for an existing mail message?

    You can't be sure that you will receive only MailItem object. That's why I'd suggest using the "is" or "as" operator in C#.

    What exactly are you going to implement? Could you please describe your final goal?

    Monday, October 27, 2014 4:06 PM
  • It will still be MailItem, but its Sent property will be true.


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

    Monday, October 27, 2014 8:37 PM