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); }