How to work with mhtml ? 
Author Message
 How to work with mhtml ?

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.



Sat, 18 Sep 2004 15:00:34 GMT  
 How to work with mhtml ?
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


Quote:
> 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.



Sat, 18 Sep 2004 17:45:22 GMT  
 How to work with mhtml ?
Thank Sam Martin.
But I want to Know:
How to use webbrowser ctl to display the Mhtml formated body other than
saving to files.


Sun, 19 Sep 2004 10:41:51 GMT  
 How to work with mhtml ?

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


Quote:
> Thank Sam Martin.
> But I want to Know:
> How to use webbrowser ctl to display the Mhtml formated body other than
> saving to files.



Sun, 19 Sep 2004 18:48:39 GMT  
 How to work with mhtml ?
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

......

<!--Attachment-->
------=_NextPart_000_00E4_01C1DBDB.DAC37D50
Content-Type: image/gif;
 name="close_o.gif"
Content-Transfer-Encoding: base64

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



Mon, 20 Sep 2004 14:08:02 GMT  
 How to work with mhtml ?
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


Quote:
> 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

> ......

> <!--Attachment-->
> ------=_NextPart_000_00E4_01C1DBDB.DAC37D50
> Content-Type: image/gif;
>  name="close_o.gif"
> Content-Transfer-Encoding: base64


R0lGODlhCwALAIAAAAAAAP///yH5BAAAAAAALAAAAAALAAsAAAIXhI8Wy6z5QJBnTkqvrhzb+D0b

- Show quoted text -

Quote:
> pDUNBBUAOw==
> ------=_NextPart_000_00E4_01C1DBDB.DAC37D50--
> ......



Mon, 20 Sep 2004 17:43:48 GMT  
 How to work with mhtml ?
CDO object made my work convenience,It is realy good.

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



Tue, 21 Sep 2004 09:22:05 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. When IE6 display mail of mhtml , the focus disappear. Why?

2. this code works on SGI does not work on linux

3. reinstall IIS - how to get ASPX files to work again - ASP does work

4. C++/ATL/ADO - Intellisense not working (statement completion options) not working

5. CMap Lookup not working (at least I cannot get it to work)

6. SaveBarState (WORKS) LoadBarState(Doesn't Work)?

7. Program not work at release mode but work at debug mode

8. GetPrivateProfileSectionNames works in 2000, doesn't work in 98 or ME

9. GetPrivateProfileSectionNames not working in 98 or ME but does work in 2000

10. Tooltip works and then doesn't work

11. ACCELERATOR KEYS DON'T WORK WITH OnKeyDown BUT WORK WHEN SPY++ IS RUNNING

12. Q147740 CWnd work-around doesn't work with control that uses lic file

 

 
Powered by phpBB® Forum Software