使用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
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18