c# 获得当前打开的word 文档

 Microsoft.Office.Interop.Word.Application wdApp = (Microsoft.Office.Interop.Word.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application");

            Microsoft.Office.Interop.Word.Documents oDocs = wdApp.Documents;
            Debug.WriteLine("当前的Word实例共打开" + oDocs.Count + "个文档:");
            foreach (Microsoft.Office.Interop.Word.Document oDoc in oDocs)
            {
                Debug.WriteLine(oDoc.FullName);
            }

 

c# 获得当前打开的word 文档

上一篇:C# 使用正则表达式按指定长度分割字符串


下一篇:C#接口与抽象类学习笔记