Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to work with mhtml ?

4 views
Skip to first unread message

malei

unread,
Apr 2, 2002, 2:00:34 AM4/2/02
to
In CDO ,The CreateMHTMLBody method converts the contents of an entire Web
page into a MIME Encapsulation of Aggregate HTML Documents (MHTML) formatted
message body.

Can you tell me how to display the body in webbrowser ctl other than saving
to files.


Sam Martin

unread,
Apr 2, 2002, 4:45:22 AM4/2/02
to
For the WebBrowser control, call navigate2 passing the page you want.
Add an event handler for OnNavigate2Complete.
From the event handler can get the document object from the document
property of the webbrowser control.
From the document object you can get the HTMLBodyElementClass object.

MSHTML.HTMLDocumentClass htmlDoc = (MSHTML.HTMLDocumentClass)_axWb.Document;

MSHTML.HTMLBodyClass _body;

_body = (MSHTML.HTMLBodyClass) htmlDoc.body;

To display the HTML use the _body.outerHTML attribute.

HTH


"malei" <ma...@bisp.com> wrote in message
news:#gcccMh2BHA.428@tkmsftngp03...

malei

unread,
Apr 2, 2002, 9:41:51 PM4/2/02
to
Thank Sam Martin.
But I want to Know:
How to use webbrowser ctl to display the Mhtml formated body other than
saving to files.

Sam Martin

unread,
Apr 3, 2002, 5:48:39 AM4/3/02
to

Once you have access to the DOM you can do anything you like. For example,

Could nav2 a page on the internet, get the body element and store
body.innerHTML in a string. Navigate2 a placeholder page, and replace the
innerHTML of the body with that held in the string.

I think I know what you're actually trying to do, that is to render an HTML
page straight from a string containing the complete HTML document (without
writing to file and naving to it)

I have spent another half hour or so looking to see how else it can be done,
but the only way i can see is by building the page using the MSHTML
interfaces or navigating to it.

HTH

Sam

"malei" <ma...@bisp.com> wrote in message

news:e43Ljgr2BHA.2164@tkmsftngp02...

malei

unread,
Apr 4, 2002, 1:08:02 AM4/4/02
to
Yes, You are right.
In face , The most thing I interested is How to display the special part ?
For example, I have no idea about how to display the image in the body;

<!--mime body-->
......
<FONT size=2><IMG
src="cid:00e301c1db98$cc9eb6b0$2400a8c0@maleidotnet"></FONT>
......

<!--Attachment-->
------=_NextPart_000_00E4_01C1DBDB.DAC37D50
Content-Type: image/gif;
name="close_o.gif"
Content-Transfer-Encoding: base64
Content-ID: <00e301c1db98$cc9eb6b0$2400a8c0@maleidotnet>

R0lGODlhCwALAIAAAAAAAP///yH5BAAAAAAALAAAAAALAAsAAAIXhI8Wy6z5QJBnTkqvrhzb+D0b
pDUNBBUAOw==
------=_NextPart_000_00E4_01C1DBDB.DAC37D50--
......


Sam Martin

unread,
Apr 4, 2002, 4:43:48 AM4/4/02
to
ah, with ya.

How about using the CDO objects to manually construct the HTML page.
or
See if someone else has done it and supplied the source code


Just ideas mate, haven't ever done what you're trying to do. (would be
interested if you find a solution though)

Good luck

Sam

"malei" <ma...@bisp.com> wrote in message

news:#dwZb452BHA.2840@tkmsftngp05...

malei

unread,
Apr 4, 2002, 8:22:05 PM4/4/02
to
CDO object made my work convenience,It is realy good.

Last , Thank you very much for your help.
Truly.


0 new messages