如何在.net 2.0中的Windows应用程序中生成word文档 [英] how can i generate word documents in windows application in .net 2.0
本文介绍了如何在.net 2.0中的Windows应用程序中生成word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的代码是:
string StrContent = < span class =code-string>< 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组件
可以帮助我。
提前感谢!
解决方案
见这里
http://www.csharp-station.com/Articles/WordReports.aspx [ ^ ]
http://nishantrana.wordpress.com/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
http://www.csharp-station.com/Articles/WordReports.aspx[^]
http://nishantrana.wordpress.com/2007/11/03/creating-word-document-using-c/[^]
Thanks
--RA
这篇关于如何在.net 2.0中的Windows应用程序中生成word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文