用C#把数据库中的记录按格式写入Word文档中。
来源:互联网 发布:ota升级会清除数据吗 编辑:程序博客网 时间:2024/05/30 07:14
用C#把数据库中的记录按格式写入Word文档中。
使用Word的COM组件。
Word._Application app = new Word.ApplicationClass();
app.Visible = false;
object nothing = System.Reflection.Missing.Value;
object temp = Environment.CurrentDirectory + @"/resume.doc"; //文档模板
Word.Document doc = app.Documents.Open(ref temp,ref nothing,ref nothing,ref nothing,
ref nothing,ref nothing,ref nothing, ref nothing, ref nothing,
ref nothing,ref nothing,ref nothing,ref nothing,ref nothing,ref nothing,ref nothing);//打开模板
doc.Tables[1].Cell(1,2).Range.Text = ""; // 给单元格添加内容
//给单元格插入图片
doc.Tables[1].Cell(1,5).Range.InlineShapes.AddPicture(ImgPath,ref nothing,ref nothing,ref nothing);
转自:http://blog.csdn.net/duwx/archive/2004/07/05/34188.aspx
- 用C#把数据库中的记录按格式写入Word文档中。
- 用C#把数据库中的记录按格式写入Word文档中
- 用C#把数据库中的记录按格式写入Word文档中
- 用C#把数据库中的记录按格式写入Word文档中。
- 用C#把数据库中的记录按格式写入Word文档中
- 把文本中的记录写入数据库中
- 把文本中的记录写入数据库中
- 如何把数据库的内容写入到Word文档中
- 如何把数据库的内容写入到Word文档中?
- C#中写入与保存Word文档
- 把word文档写入Sqlserver
- C#将数据库内容写入Word中
- Javascript 将数据库中的数据写入WORD文档的表格中
- 如何把数据库以二进制存储的excel,word文档写入excel,word
- 在Delphi中如何把数据库中的记录引到word中
- 在Delphi中如何把数据库中的记录引到word中
- 利用C#向word文档中写入数据
- 利用C#向word文档中写入数据
- ILOG JViews 技术讲座
- 希腊字母和读音对照
- C++ Under The Hood(中译版)
- .NET Remoting的广播和回调问题
- 各种类型在xp系统中占用的字节数
- 用C#把数据库中的记录按格式写入Word文档中。
- ASP.NET面试题
- WINDOWS下的低级音频函数
- 在 html 中如何定义 css
- MMC不能打开这个C:/Program Files/Microsoft SQL Server/80/Tools/Binn/SQL Server Enterprise Manager.MSC。
- AutoComplete
- Window 编程之句柄篇
- test
- 迪拜(六)漫漫大漠 下