告诉个不用控件的办法,关于使用office组件随便到本论坛搜索就可以找的到,所以我用一个比较另类的办法,首先在页面提交的时候把TXT通过流保存到文件,但文件的扩展名使用.DOC,这样WORD可以自动转化.另:关于webform使用office组件,建议使用webservice防止没有权限问题.
解决方案 »
- 多线程操作ACCESS数据库后关闭时出错,求解!急急急……
- WINFORM中webBrowser读取网页中的FLASH,然后点FLASH中的某个图片
- 请教高手 excel 导出 问题
- gdi+扇形的颜色对称填充
- ASP.NET 发布后,怎样才能在 Exception 中获得详细信息,例如行号?
- dateTimePicker控件怎么显示英文时间
- c#中如何在数据库中存储utf-8编码的数据
- 各侠大侠,我真的是没分了!为什么我放在.aspx中的用windows应用程序写的.dll无法做数据库写入的工作。报错,权限问题
- .net引用了一个activex控件,怎么把它拖到窗口里啊?
- 在生成部署安装项目时为什么会报“不可恢复的生成错误”?
- DataGrid背景色?
- 在方法中要定义一个私有变量?
Object Nothing=System.Reflection.Missing.Value;
object filename = "D:\\"+wordname + ".DOC";
Word.Application WordApp=new Word.ApplicationClass();
Word.Document WordDoc=WordApp.Documents.Add(ref Nothing,ref Nothing,ref Nothing,ref Nothing);
Word.Table table=WordDoc.Tables.Add(WordApp.Selection.Range,1,1,ref Nothing,ref Nothing);
table.Cell(1,1).Range.Text=wordname;
WordDoc.Paragraphs.Last.Range.Text=wordText;
WordDoc.SaveAs(ref filename,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing);
WordDoc.Close(ref Nothing, ref Nothing, ref Nothing);
WordApp.Quit(ref Nothing, ref Nothing, ref Nothing);
说宏出错误啊