c# word对象模型 怎么获取打开的word文档中选中的文字 本帖最后由 suzhongyu1 于 2011-03-16 21:07:25 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1 private string ResumeWord(string path) 2 { 3 string str = string.Empty; 4 Document myWordDoc; 5 Microsoft.Office.Interop.Word.Application myWordApp = new Microsoft.Office.Interop.Word.ApplicationClass(); 6 7 object filepath = path; 8 object oMissing = Missing.Value; 9 10 myWordDoc = myWordApp.Documents.Open(ref filepath, ref oMissing, ref oMissing, ref oMissing, ref oMissing,11 ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,12 ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);13 str = myWordDoc.Content.Text;14 15 return str;16 } 或者参考http://topic.csdn.net/u/20100530/15/5b272e55-1b54-4eed-b5bd-f0dd34295dae.htmlhttp://www.codeproject.com/KB/office/Word_Automation.aspx c#新手 请教。如何使用 Key为英文 的多维集合,数组 高手帮看看啥问题 新手求教 c#结构体指针的问题 C#连接MySql问题 [**求助**]有关安全问题,就是通不过安全软件~~ 关于动态增加控件的问题?比较棘手的问题。 对于想好发展的.net开发人员,需要学习COM+吗?如果需要,学习她有什么用? .NET Remoting在三层应用中的模式讨论 菜鸟送100分(TreeView) C#中 lock& double lock用法是怎么样?尤其是double lock? 关于Excel导入、上传的问题!!!急 !!
1 private string ResumeWord(string path)
2 {
3 string str = string.Empty;
4 Document myWordDoc;
5 Microsoft.Office.Interop.Word.Application myWordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
6
7 object filepath = path;
8 object oMissing = Missing.Value;
9
10 myWordDoc = myWordApp.Documents.Open(ref filepath, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
11 ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
12 ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
13 str = myWordDoc.Content.Text;
14
15 return str;
16 }
http://topic.csdn.net/u/20100530/15/5b272e55-1b54-4eed-b5bd-f0dd34295dae.htmlhttp://www.codeproject.com/KB/office/Word_Automation.aspx