用ASP.NET把数据库中的记录按格式写入Word文档中
Admin
|
2007-10-10 22:35:31
|
TrackRecord:
2244
Times | Tag标签:asp.net
打印本页
您当前所处的位置是:〖首页〗→【文章页】
本站共有16个图文教程栏目,请用心拜读!
本站提供经典的Excel公式函数实例,Word排版技巧,PPT教程;同时更兼有Flash,PowerPoint,数据库等技术文章。
使用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);
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=34188
会员评论列表:

正在加载数据,请稍后……
针对本篇文章或本站,请您发表个人的建议或批评!