本文介绍了如何将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.ThanksAtulDim 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页面内容插入到word文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-14 20:17