本文介绍了从c#转换的mht文件的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html文件,其中一些图像链接在另一个文件夹中。现在使用CDO dll我已经从那个html.Problem创建了mht文件,该文件无法在word中打开,它只能在IE中打开。



但是当我在IE中打开创建的mht文件然后从页面保存页面 - >保存为 - > .mht选项然后mht文件可以用word打开。



那么IE为该文件增加了额外的内容,以便可以用文字打开它?



我的代码是------------------------------------------- ---------------------------------------

CDO.Message msg = new CDO.MessageClass();

CDO.Configuration cfg = new CDO.ConfigurationClass();

msg.Configuration = cfg;





msg.CreateMHTMLBody(file://+ myhtmlfilepath,CDO.CdoMHTMLFlags.cdoSuppressAll,,);



msg.GetStream()。SaveToFile(mylocation + \\\test.mht,ADODB.SaveOptionsEnum.adSaveCreateOverWrite);

I have a html file with some images linked which are in another folder.Now using CDO dll I have created mht file from that html.Problem is,the file can not be opened in word,it can only be opened in IE.

But when i open the created mht file in IE and then save the page from page->save as ->.mht option then the mht file can be opened in word.

So what IE adds extra to that file so that it can be opened in word?

My code is----------------------------------------------------------------------------------
CDO.Message msg = new CDO.MessageClass();
CDO.Configuration cfg = new CDO.ConfigurationClass();
msg.Configuration = cfg;


msg.CreateMHTMLBody("file://"+myhtmlfilepath, CDO.CdoMHTMLFlags.cdoSuppressAll,"","");

msg.GetStream().SaveToFile(mylocation+"\\test.mht", ADODB.SaveOptionsEnum.adSaveCreateOverWrite);

推荐答案


这篇关于从c#转换的mht文件的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 00:04