R
RichW
Good morning.
I am using the XP PIA and .NET.
For HTML emails that I print programmatically, I often get an error
message. I asked for some help on this and it was recommended (by Sue
Mosher - thank you!) that I use Inspector.HTMLEditor to return an
HTMLDocument object, then loop until its readystate property returns
Complete. So, I started on the following snippet and I am having
problems.
(using reference Microsoft.mshtml)
(oMsg is a reference to a mailItem):
Microsoft.Office.Interop.Outlook.MailItem MI =
(Microsoft.Office.Interop.Outlook.MailItem) oMsg;
IHTMLDocument2 oInspect;
Microsoft.Office.Interop.Outlook.Inspector Inspect =
(Microsoft.Office.Interop.Outlook.Inspector) MI.GetInspector;
// Here is where I use Inspector.HTMLEditor to return an HTMLDocument
object
oInspect = Inspect.HTMLEditor;
Unfortunately, the above statement does not compile. I get the error:
Cannot implicitly convert type 'object' to 'mshtml.IHTMLDocument2'
Any ideas? I am flummoxed here.
All the best,
- Rich
I am using the XP PIA and .NET.
For HTML emails that I print programmatically, I often get an error
message. I asked for some help on this and it was recommended (by Sue
Mosher - thank you!) that I use Inspector.HTMLEditor to return an
HTMLDocument object, then loop until its readystate property returns
Complete. So, I started on the following snippet and I am having
problems.
(using reference Microsoft.mshtml)
(oMsg is a reference to a mailItem):
Microsoft.Office.Interop.Outlook.MailItem MI =
(Microsoft.Office.Interop.Outlook.MailItem) oMsg;
IHTMLDocument2 oInspect;
Microsoft.Office.Interop.Outlook.Inspector Inspect =
(Microsoft.Office.Interop.Outlook.Inspector) MI.GetInspector;
// Here is where I use Inspector.HTMLEditor to return an HTMLDocument
object
oInspect = Inspect.HTMLEditor;
Unfortunately, the above statement does not compile. I get the error:
Cannot implicitly convert type 'object' to 'mshtml.IHTMLDocument2'
Any ideas? I am flummoxed here.
All the best,
- Rich