本文介绍了如何在 2.0中的Windows应用程序中生成word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,每个人都好。我想从我的Windows应用程序生成word文档。在Windows应用程序中,我创建了一个名为generate的按钮,如果我单击它需要生成一个单词文档。 我的代码是: string StrContent = < table border ='0'style ='margin-removed10px; margin-removed20px;' cellpadding ='5'cellspacing ='1'>; StrContent + = < tr>< td valign ='top'bgcolor ='#FFFFFF' style ='font-weight:normal; font-family: + 这是我的第一个应用程序 + < / td>< / tr>; StrContent + = < / table>; WebBrowser webbrowser1 = new WebBrowser(); webbrowser1.DocumentText = StrContent; webbrowser1.Document.Title = 问题Papper; webbrowser1.Width = 1000 ; webbrowser1.ShowPrintDialog();
但我收到错误,因为ERROR HRESULT E_FAIL已从cal返回到a com组件 可以帮助我。 提前感谢!
解决方案见这里 www.csharp-station/Articles/WordReports.aspx [ ^ ] nishantrana.wordpress/2007/11/03/creating-word-document-using-c/ [ ^ ] 谢谢 --RA
hello to every body. i want to generate word documents from my windows application. in windows application i created one button named generate, if i click it the one word document ll need to generate. my code is:
string StrContent = "<table border='0' style='margin-removed10px; margin-removed20px;' cellpadding='5' cellspacing='1'>"; StrContent += "<tr><td valign='top' bgcolor='#FFFFFF' style='font-weight: normal; font-family:" + "This is my first application" + "</td></tr>"; StrContent += "</table>"; WebBrowser webbrowser1 = new WebBrowser(); webbrowser1.DocumentText = StrContent; webbrowser1.Document.Title = "Question Papper"; webbrowser1.Width = 1000; webbrowser1.ShowPrintDialog();but i got an error as ERROR HRESULT E_FAIL has been returned form a cal to a com component can any plz help me. thanks in advance!
解决方案 See here www.csharp-station/Articles/WordReports.aspx[^] nishantrana.wordpress/2007/11/03/creating-word-document-using-c/[^] Thanks --RA更多推荐
如何在.net 2.0中的Windows应用程序中生成word文档
发布评论