如何在.net 2.0中的Windows应用程序中生成word文档

编程入门 行业动态 更新时间:2024-10-26 12:34:58
本文介绍了如何在 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文档

本文发布于:2023-11-11 10:53:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1578223.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   文档   如何在   net   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!