如何将aspx页面内容插入到word文件中 [英] how to insert aspx page contents into a word file
本文介绍了如何将aspx页面内容插入到word文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我可以使用以下代码创建一个新的word文件。现在,我没有为数据编写所有新代码,而是希望将aspx页面的内容插入其中。请指导。我已经在网上搜索了但是对此没有任何想法。
谢谢
Atul
Hi All,
I am able to create a new word file with below code. Now, instead of writing all new code for data I want to insert the contents of an aspx page into it. Pls guide. i have searched the net but could not find any idea for this.
Thanks
Atul
Dim wordApp As New Application()
Dim filePath As Object = "H:\TestDocument.docx"
Dim missing As Object = System.Reflection.Missing.Value
Dim wordDoc As Document = wordApp.Documents.Add(missing, missing, missing, missing)
wordDoc.Activate()
wordDoc.Content.InsertBefore("This is Word document created in ASP.NET")
wordDoc.Content.InsertParagraphAfter()
wordDoc.SaveAs(filePath)
wordApp.Application.Quit(missing, missing, missing)
推荐答案
如果你想保存整个aspx页面,请浏览以下网址。
< a href =http://forums.asp.net/t/1204503.aspx> http://forums.asp.net/t/1204503.aspx [ ^ ]
如果我知道你需要任何帮助。
If you want to save whole aspx page then go through the below URL.
http://forums.asp.net/t/1204503.aspx[^]
Let me know if you need any help.
这篇关于如何将aspx页面内容插入到word文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文