c# 获得当前打开的word 文档
2021-01-20 22:12
标签:ica cti foreach int debug reac style runtime 获得 c# 获得当前打开的word 文档 标签:ica cti foreach int debug reac style runtime 获得 原文地址:https://www.cnblogs.com/gisbeginner/p/12118341.html 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);
}