Does Outlook/MS have an API to parse HTML?

E

Eric

I'm writing an Outlook add-in which is going to work with HTML emails.
In another program I've written I loaded HTML into the MSHTML
(Internet Explorer) control and used the DOM (document object module)
which makes it easy to edit the HTML tags. Now I'm trying to open an
HTML file, from disk, edit a few IMG tags, and then send that HTML to
Outlook, and I'd like to avoid having to load the HTML into a hidden
MSHTML control just to parse it. Does Outlook exposes any functions
to help with this, via Outlook Object Module, Extended MAPI, or via
some other DLL/OCX?
 
D

Dmitry Streblechenko

You don't have to create an invisible control for that - create an instance
of IHTMLDocument2, QI it for IPersistStreamInit and load the HTML. Wait
until the document is parsed and you are done.
See walkall sample on MSDN.
HTML parsing has nothing to do with Outlook or Extended MAPI, you need to
use the standard IE functionality for that, that's what Outlook itself does
AFAIK.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
E

Eric

Thank you. I was thinking maybe I remember Outlook/OE having an HTML
API, but I guess it was just MIME I was thinking about. I found the
walkall sample, and it looks simple enough (wish I had found that for
another project I did about a year ago).

Dmitry Streblechenko said:
You don't have to create an invisible control for that - create an instance
of IHTMLDocument2, QI it for IPersistStreamInit and load the HTML. Wait
until the document is parsed and you are done.
See walkall sample on MSDN.
HTML parsing has nothing to do with Outlook or Extended MAPI, you need to
use the standard IE functionality for that, that's what Outlook itself does
AFAIK.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


Eric said:
[...trim...]Does Outlook exposes any functions
to help with this, via Outlook Object Module, Extended MAPI, or via
some other DLL/OCX?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top