1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > html格式图片可以转换成word文档 html网页转换成word文档 转换成功 并且可以保存图

html格式图片可以转换成word文档 html网页转换成word文档 转换成功 并且可以保存图

时间:2021-12-30 05:52:21

相关推荐

html格式图片可以转换成word文档 html网页转换成word文档 转换成功 并且可以保存图

当前位置:我的异常网» C#»html网页转换成word文档,转换成功,并且可以保存图

html网页转换成word文档,转换成功,并且可以保存图片,但是总是为"web版式"的格式,怎么改成“页面”格式,多谢

网友分享于:-06-09浏览:866次

html网页转换成word文档,转换成功,并且可以保存图片,但是总是为"web版式"的格式,如何改成“页面”格式,谢谢

转换成功,并且可以保存图片,但是总是为"web版式"的格式,如何改成“页面”格式,谢谢

Word.Document thisDocument = null;

Word.FormFields formFields = null;

Word.Application thisApplication = new Word.ApplicationClass();

thisApplication.Visible = true;

thisApplication.Caption = "";

thisApplication.Options.CheckSpellingAsYouType = false;

thisApplication.Options.CheckGrammarAsYouType = false;

Object ConfirmConversions = false;

Object ReadOnly = true;

object AddToRecentFiles = true;

Object PasswordDocument = System.Type.Missing;

Object PasswordTemplate = System.Type.Missing;

Object Revert = System.Type.Missing;

Object WritePasswordDocument = System.Type.Missing;

Object WritePasswordTemplate = System.Type.Missing;

Object Format = System.Type.Missing;//

Object Encoding = System.Type.Missing;

Object Visible = System.Type.Missing;

Object OpenAndRepair = System.Type.Missing;

Object DocumentDirection = System.Type.Missing;

Object NoEncodingDialog = System.Type.Missing;

Object XMLTransform = System.Type.Missing;

object FileFormat = Word.WdSaveFormat.wdFormatDocument;

object SaveNativePictureFormat = false;

object LineEnding = Word.WdLineEndingType.wdCRLF;//Word.WdLineEndingType.wdLSPS;

Word.ApplicationClass word = new ApplicationClass();

object nothing = System.Reflection.Missing.Value;

//路径

object filename = "D:\\test.html";

string FileName="D:\\test.doc";

Word.Document doc =

thisApplication.Documents.Open(ref filename, ref ConfirmConversions,

ref ReadOnly, ref AddToRecentFiles, ref PasswordDocument, ref PasswordTemplate,

ref Revert, ref WritePasswordDocument, ref WritePasswordTemplate, ref Format,

ref Encoding, ref Visible, ref OpenAndRepair, ref DocumentDirection,

ref NoEncodingDialog, ref XMLTransform);

//doc.Paragraphs.Last.Range.Text = this.richTextBox1.Text;

object myfileName = FileName;

//将WordDoc文档对象的内容保存为doc文档

doc.SaveAs(ref myfileName,ref FileFormat, ref nothing, ref nothing, ref AddToRecentFiles, ref nothing, ref nothing, ref nothing,ref SaveNativePictureFormat, ref nothing, ref nothing, ref nothing, ref nothing, ref nothing, ref LineEnding, ref nothing);

//关闭WordDoc文档对象

doc.Close(ref nothing, ref nothing, ref nothing);

//关闭WordApp组件对象

word.Quit(ref nothing, ref nothing, ref nothing);

Response.Write("successfully!");

System.Diagnostics.Process[] ps = System.Diagnostics.Process.GetProcesses();

foreach (System.Diagnostics.Process p in ps)

{

if (p.ProcessName.ToLower().CompareTo("winword") == 0)

p.Kill();

}

------解决方案--------------------

不知道 友情帮顶

文章评论

html格式图片可以转换成word文档 html网页转换成word文档 转换成功 并且可以保存图片 但是总是为web版式的格式 怎么改成“页面”格式 多谢...

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。