J
jeff.boggs
Hello,
I have a problem inserting HTML from a Word document into a new Outlook
mail message. The message ends up losing all of the formatting and the
image that is supposed to appear at the top of the message does not.
Here is the code for inserting the HTML.
var oOutlookApp, oWordApp, oOutlookMsg, iOutlookRunning;
iOutlookRunning = false;
var attach = "c:\\test.txt"
var attach2 = "c:\\test.txt"
var attach3= "c:\\EmailTemplate.htm";
//Create Outlook Object
oOutlookApp = new ActiveXObject("Outlook.Application");
oDoc = new ActiveXObject("Word.Application");
//Create Outlook Message
oOutlookMsg = oOutlookApp.CreateItem(0);
oOutlookMsg.BodyFormat = 2;
oDoc.Visible = false;
oDoc.Documents.Open(attach3);
iOutlookRunning = true;
oOutlookMsg.To = sText + "@inovex.ca";
oOutlookMsg.Subject = "test";
oOutlookMsg.Body = oDoc.ActiveDocument.Content;
oOutlookMsg.Attachments.Add(attach,1);
oOutlookMsg.Attachments.Add(attach2,2);
oOutlookMsg.Attachments.Add(attach3,3);
//Send Email
oOutlookMsg.Send;
I have a problem inserting HTML from a Word document into a new Outlook
mail message. The message ends up losing all of the formatting and the
image that is supposed to appear at the top of the message does not.
Here is the code for inserting the HTML.
var oOutlookApp, oWordApp, oOutlookMsg, iOutlookRunning;
iOutlookRunning = false;
var attach = "c:\\test.txt"
var attach2 = "c:\\test.txt"
var attach3= "c:\\EmailTemplate.htm";
//Create Outlook Object
oOutlookApp = new ActiveXObject("Outlook.Application");
oDoc = new ActiveXObject("Word.Application");
//Create Outlook Message
oOutlookMsg = oOutlookApp.CreateItem(0);
oOutlookMsg.BodyFormat = 2;
oDoc.Visible = false;
oDoc.Documents.Open(attach3);
iOutlookRunning = true;
oOutlookMsg.To = sText + "@inovex.ca";
oOutlookMsg.Subject = "test";
oOutlookMsg.Body = oDoc.ActiveDocument.Content;
oOutlookMsg.Attachments.Add(attach,1);
oOutlookMsg.Attachments.Add(attach2,2);
oOutlookMsg.Attachments.Add(attach3,3);
//Send Email
oOutlookMsg.Send;