I'm trying to add a string in the end of an Outlook email's body with VSTO
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
this.Application.ItemSend += new Microsoft.Office.Interop.Outlook.ApplicationEvents_11_ItemSendEventHandler(Application_ItemSend);
}
void Application_ItemSend(object Item, ref bool Cancel)
{
if (Item is Outlook.MailItem)
{
Outlook.MailItem mail = (Outlook.MailItem)Item;
mail.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML;
mail.Body += "My Sample Text";
mail.Save();
}
}
When i run with F5 my code from VStudio, the app isn't stopping in my breakpoints and the emails do not contain the added line
What I can do about it?
Note: I'm working with VS2008 and Outlook 2007
Thanks in advance
Sorry...
The problem was i've to close my outlook and restarted with F5.
If someone have this same issue, now you know
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With