1. 如何将HTML文件转换成WORD文档
1、保存网页zd
在浏览器中访问目标网页,执行菜单“文件”→“另存为”,文件类型选择“网页,全部”。
2、用WPS文字打开html文件内
执行“文件”→“打开”,文件类型选择“网页文件”或“所有文件”,以打开刚才下载得到的《[征稿八]怎样用WPS制作PDF》html文件。
3、去掉不需要的部分
注:表格形式出现的正文,可以选中后执行“表格”→“转换”→“表格转换为文本”去除表格外框。
4、最后另容存为WPS文档或WORD文档即可。
2. asp.net导出word
public void Download()
{
Random rd = new Random();
string fileName = DateTime.Now.ToString("yyyyMMddhhmm") + rd.Next() + ".doc";
//存储路径
string path = Server.MapPath(fileName);
//创建字符输出流
StreamWriter sw = new StreamWriter(path, true, System.Text.UnicodeEncoding.UTF8);
//需要导出的内容
string str = "<html><head><title>;无标题文档</title></head><body>;这里放从数据库导出的word文档内容</body></html>";
//写入
sw.Write(str);
sw.Close();
Response.Clear();
Response.Buffer = true;
this.EnableViewState = false;
Response.Charset = "utf-8";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.ContentType = "application/octet-stream";
Response.WriteFile(path);
Response.Flush();
Response.Close();
Response.End();
}
标准word文档的格式微软暂未公布,由此我们可将需要导出的内容转为标准HTML文件储存,后缀名为.doc
也可以将要导出内容转为标准XML格式存储,改后缀为.doc
具体格式随意新建个word文档,输入内容,另存为.XML可见
另外一种导出方式为word导出标准格式,服务器需要安装Microsoft Office word,需要预先设置好一个word文档并在要插入内容的地方设置书签做为模版,导出word文档时需要先遍历模版文件中的所有书签,然后给书签赋值就能实现导出数据了
还有不懂的可以直接百度HI我
是否可以解决您的问题?
3. 如何将HTML格式转化为word
我觉得你可以看一下专家的这份资料:[原创并分享]ppt 转 wordhtml" target="_blank"> ppt文件转word文档:ppt convert to doc 1.0绿色版本程序可以将ppt文件的所有文字内容(包括幻灯片和备注)提取成word文档,该文件保存于ppt文件所在目录,若ppt文件名为“xxx.ppt”,则转换获得的word文档的文件名将是“xxx.ppt.convertor.doc”。
本程序转换后的word文档中文字顺序排列,并未排版,因此尚需用户自行调整。本程序无需安装,直接运行。
最好将之前运行的 word 和 powerpoint 程序均关闭。将欲操作的ppt文件拖入程序,按程序界面中的“开始”按钮即可。
操作过程中幻灯片和word文档自行活动,不必担心。转换时间视幻灯片文字多少而定,一般1至2分钟搞定。
转换结束后程序自动退出。 转换前可以选择获是否在得的word文档中添加分隔标志文字。
若选择添加,则分隔标志文字的格式为:page no.x:表明其后的文字源于第x张幻灯片;wordsfromslide:表明其后的文字源于幻灯片页面;wordsfromnotepage:表明其后的文字源于备注页面。 解决办法一,有一款小软件叫ppt2word可以将ppt里面的文字提取出来转化成word 速度很快 但不能提取图片 很好用 。
解决办法二,文件,另存为,大纲/rtf文件,然后就可以看到一个用word打开的大纲文档文件了,是只有大纲的。 解决办法三,有个软件好象叫 cz-ppt2txt for ms powerpoint,可以转化的,我没用过,不过听说挺好用的。
可以百度一下,下个这个小软件。 解决办法四,和方法二类似,就是“打开需要转换的演示文稿,执行“文件发送microsoft office word”命令,打开“发送到microsoft office word”对话框,选中其中的“只使用大纲”选项,按下“确定”按钮,系统自动启动word,并将演示文稿中的字符转换到word文档中,编辑保存即可。
注意:要转换的演示文稿必须是用powerpoint内置的“幻灯片版式”制作的幻灯片。如果是通过插入文本框等方法输入的字符,是不能实现转换的。”
所以第四个方法并不怎么实用的样子。
^_^。
祝愿楼主可以早点解决问题啊。
^_^。
4. 如何将Asp.net页面导入到World里
有图片就没试过哦!下面是关键性代码,但只是生成文字!希望对您有用添加引用:using Microsoft.Office.Interop.Word; //============================ private unsafe void ThreadWork() { try { this.SetBtnDisable(); string str = "数据库名:" + this.dbname; int count = this.listTable2.Items.Count; this.SetprogressBar1Max(count); this.SetprogressBar1Val(1); this.SetlblStatuText("0"); object template = Missing.Value; object obj3 = @"\endofdoc"; Microsoft.Office.Interop.Word._Application application = new Microsoft.Office.Interop.Word.ApplicationClass(); application.Visible = false; Microsoft.Office.Interop.Word._Document document = application.Documents.Add(ref template, ref template, ref template, ref template); application.ActiveWindow.View.Type = Microsoft.Office.Interop.Word.WdViewType.wdOutlineView; application.ActiveWindow.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekPrimaryHeader; application.ActiveWindow.ActivePane.Selection.InsertAfter("导出到Word"); application.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphRight; application.ActiveWindow.View.SeekView = Microsoft.Office.Interop.Word.WdSeekView.wdSeekMainDocument; Microsoft.Office.Interop.Word.Paragraph paragraph = document.Content.Paragraphs.Add(ref template); paragraph.Range.Text = str; paragraph.Range.Font.Bold = 1; paragraph.Range.Font.Name = "宋体"; paragraph.Range.Font.Size = 12f; paragraph.Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter; paragraph.Format.SpaceAfter = 5f; paragraph.Range.InsertParagraphAfter(); for (int i = 0; i columnInfoList = this.dbobj.GetColumnInfoList(this.dbname, tableName); int num3 = columnInfoList.Count; if ((columnInfoList != null) && (columnInfoList.Count > 0)) { object obj4 = document.Bookmarks.get_Item(ref obj3).Range; Microsoft.Office.Interop.Word.Paragraph paragraph2 = document.Content.Paragraphs.Add(ref obj4); paragraph2.Range.Text = str3; paragraph2.Range.Font.Bold = 1; paragraph2.Range.Font.Name = "宋体"; paragraph2.Range.Font.Size = 10f; paragraph2.Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter; paragraph2.Format.SpaceBefore = 15f; paragraph2.Format.SpaceAfter = 1f; paragraph2.Range.InsertParagraphAfter(); obj4 = document.Bookmarks.get_Item(ref obj3).Range; Microsoft.Office.Interop.Word.Paragraph paragraph3 = document.Content.Paragraphs.Add(ref obj4); paragraph3.Range.Text = ""; paragraph3.Range.Font.Bold = 0; paragraph3.Range.Font.Name = "宋体"; paragraph3.Range.Font.Size = 9f; paragraph3.Range.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter; paragraph3.Format.SpaceBefore = 1f; paragraph3.Format.SpaceAfter = 1f; paragraph3.Range.InsertParagraphAfter(); Microsoft.Office.Interop.Word.Range range = document.Bookmarks.get_Item(ref obj3).Range; Microsoft.Office.Interop.Word.Table table = document.Tables.Add(range, num3 + 1, 10, ref template, ref template); table.Range.Font.Name = "宋体"; table.Range.Font.Size = 9f; table.Borders.Enable = 1; table.Rows.Height = 10f; table.AllowAutoFit = true; table.Cell(1, 1).Range.Text = "序号"; table.Cell(1, 2).Range.Text = "列名"; table.Cell(1, 3).Range.Text = "数据类型"; table.Cell(1, 4).Range.Text = "长度"; table.Cell(1, 5).Range.Text = "小数位"; table.Cell(1, 6).Range.Text = "标识"; table.Cell(1, 7).Range.Text = "主键"; table.Cell(1, 8).Range.Text = "允许空"; table.Cell(1, 9).Range.Text = "默认值"; table.Cell(1, 10).Range.Text = "说明"; table.Columns[1].Width = 33f; table.Columns[3].Width = 60f; table.Columns[4].Width = 33f; table.Columns[5].Width = 43f; table.Columns[6].Width = 33f; table.Columns[7].Width = 33f; table.Columns[8].Width = 43f; for (int j = 0; j 评论0 0 0。
转载请注明出处51数据库 » asp.nethtml转word
此号被社byV先森