Reputation: 706
I have been able to setup a VSTO C# addin for Outlook which has a button on the "new mail" dialog (custom group on the "Message" Tab) and the button loads a form with a webview, which can pass back information to the add-in.
However I'm not sure how to pass in HTML into the new mail window now, to get started I just want the code to put "Hello World" into the body of the email - I've done a bit of googling on this and found nothing - any ideas?
at the moment I have the JS on the webpage running a callback on the Addin, and just doing a MessageBox.Show() but I need to figure out how to pass HTML email back based on what was selected on the webpage, but I'm sure if I can figure out just how to put HTML text into the body that will get me started.
any help on this is much appreciated.
Upvotes: 0
Views: 1455
Reputation: 66215
You can either set the MailItem.HTMLBody property or use Inspector.WordEditor (returns Word's Document object) to manipulate the body content. Inspector is returned either from MailItem.GetInspector or Application.ActiveInspector.
Upvotes: 3