Possible to create a button that Replies or Forwards selected email?

Add-in Express™ Support Service
That's what is more important than anything else

Possible to create a button that Replies or Forwards selected email?
 
Mark De Lorenzo




Posts: 21
Joined: 2015-06-22
Is it possible to create a button that Replies or Forwards selected email?
We're creating a button that when clicked, it forwards the selected or opened email to a predetermined email address.

I have found information on OnReply and OnForward events, but not the ability to actually create a forwarded email. I'm sure it would be in the area of Create Email documentation. Yet, I'm not finding it at the moment. Can you please point me in the right direction?

Thanks so much in advance.
Posted 15 Mar, 2017 14:48:22 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Mark,

Creating an email and responding to an email belongs to the Outlook object model.

You can call MailItem.Reply(), MailItem.ReplyAll(), or MailItem.Forward().

Note that an email created may differ in some respects from an email created using the Ribbon UI. Say, I heard that Outlook performs a syntax scan on the complete email body if the email is created programmatically; for an email created using UI, it scans only the response part. There are other problems; I can't remember them at the moment.

To avoid these problems, I suggest that you get Explorer.CommandBars, and than call CommandBars.ExecuteMso("Reply"). This imitates the user clicking the Reply button.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 16 Mar, 2017 05:38:54 Top