I am creating an add in for outlook 2007, and what i am trying to do is embed an image to a new email. I cannot get the embedding of the image to work, please help. My code is as follows:
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Outlook.Inspectors inspectors;
inspectors = this.Application.Inspectors;
inspectors.NewInspector +=
new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
void Inspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
Outlook.MailItem mailItem = Inspector.CurrentItem as Outlook.MailItem;
if (mailItem != null)
{
if (mailItem.EntryID == null)
{
mailItem.Subject = "This text was added by using code";
mailItem.HTMLBody = "<html><body>this is a <img src=" + @"C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg> embedded picture.</body></html>";
//mailItem.HtmlBody = "<html><body>this is a <img src=\"cid:" + @"C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg" + "\"> embedded picture.</body></html>";
}
}
}
but this is not displaying the image. Please help.
Thanks in advance.