Word.ApplicationClass WordApp = new Word.ApplicationClass();
object missing = System.Reflection.Missing.Value;
object fileName = "normal.dot"; // template file name
object newTemplate = false; object docType = 0;
object isVisible = true;// Create a new Document, by calling the Add function in the Documents collectionWord.Document aDoc = WordApp.Documents.Add(ref fileName, ref newTemplate, ref docType,
ref isVisible);
WordApp.Visible = true;
aDoc.Activate();
WordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;// Toggle the title to a Bold Font
WordApp.Selection.Font.Bold = (int)Word.WdConstants.wdToggle;WordApp.Selection.TypeText(listView1.Items[0].Text);完整代码到这里看:
http://www.c-sharpcorner.com/Code/2002/Mar/WordFromDotNet.asp
object missing = System.Reflection.Missing.Value;
object fileName = "normal.dot"; // template file name
object newTemplate = false; object docType = 0;
object isVisible = true;// Create a new Document, by calling the Add function in the Documents collectionWord.Document aDoc = WordApp.Documents.Add(ref fileName, ref newTemplate, ref docType,
ref isVisible);
WordApp.Visible = true;
aDoc.Activate();
WordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter;// Toggle the title to a Bold Font
WordApp.Selection.Font.Bold = (int)Word.WdConstants.wdToggle;WordApp.Selection.TypeText(listView1.Items[0].Text);完整代码到这里看:
http://www.c-sharpcorner.com/Code/2002/Mar/WordFromDotNet.asp
解决方案 »
- winform中随着窗体的变化,当控件溢出时自动调整控件位置,如何实现?
- 怎么知道窗口正在被预览?Windows7系统。
- [C# WinCE控件] 如何设置DoubleBuffered属性?
- C#打印问题
- 知道如何执行exe文件的人请进!(全部分就这么多了)急
- 请问在什么情况下DataGrid控件的导航提示按钮不显示在一行?
- 线程结束问题
- 如何做一个不定列的表格
- 我的数据集中的数据绑定到dataGrid了,可以WEB FORM中不能显示dataGrid!
- 请问C#里面如何判断一个字符串是不是数字型或者日期型,即相当于vbscript里面地isnumeric,isdate函数
- 看到个比较激动和恐怖的消息
- ★★求在WinForm中关于DataGrid上绑定DataSet后数据的增删改问题..★★
完成了数字签名的BS WORD文档编辑
下载到本地安装