Outlook addin - access to edit fields

A

Andrew Slivker

I have an add-in that injects a toolbar button in a new mail window. I need
to gather edit fields values from "To" and "Subject" lines as well as the
message body when a user entered something there and clicked on my toolbar
button. If on this click event I analyze MailItem (current item of the
current inspector) neither of these fields are populated. I noticed if I
save this MailItem before retrieving its properties they are there. Saving
item is not an option as it results on this MailItem being thrown into
Drafts folder which is an undesirable side effect. The question is:

How to get access to these edit fields without forcing MailItem to be saved?

Thank you,
Andrew
 
K

Ken Slovak - [MVP - Outlook]

You don't. Those fields aren't populated until the item is saved or sent.

Use flags to tell if you saved the item or the user did, trap that in
Item.Write. If you save the item delete it from Drafts when the user closes
it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top