开发指南:
1. 必须安装office的.net开发包。
2. 在工程的reference中添加com组件:Microsoft Word 11.0 Object Library
1
//打印的代码如下:
2
Microsoft.Office.Interop.Word.Application app = null;
3
Microsoft.Office.Interop.Word.Document doc = null;
4
object missing = System.Reflection.Missing.Value;
5
object templateFile = Application.StartupPath + @"\表单模版.doc";
6
try
7
2
3
4
5
6
7