最好有实例和资料,我的msn是[email protected]
解决方案 »
- 网站需要加密,就是用SSL
- C# 读取PDF文件名
- 如何让socket.Connected变为 false
- C# 关于字符串数组的赋值与使用,给ID001 - ID100 的string 数组(或者Dictionary)赋值?
- C#求个连接SQL数据库修改表信息的例子!
- 转义序列\a,\b,\p,\f,\n,\r,\t,\v中abpfnrtv的全称是什么
- 请问各位,3个整数,按从大到小,顺序输出,思路是怎么样的,有代码最好,谢谢
- 如何清空指定的几个textbox内的内容
- C# DeveXpress PanelControl 隐藏求助
- 怎么用javascript改变frame的大小
- StructLayout类是干什么用的,它有什么用,什么时候用它呀?????????????
- 基础问题,求教
Word.ApplicationClass oWord = new Word.ApplicationClass();
Word.Document oDoc;
Word.Range oRange;
Word.Table otable;
Word.Selection oselection;
object a = Missing.Value;
object b = Missing.Value;
object filename=@"c:\test.doc";
oDoc = oWord.Documents.Open(ref filename,ref a,ref a,ref a,ref
//or oDoc = oWord.Documents.Add(ref a,ref a,ref a,ref a);
a,ref a,ref a,ref a,ref a,ref a,ref a,ref a);
oWord.Visible = true;
oDoc = oWord.ActiveDocument
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
vb.net的,你可以把它改成c#的