嗨,我正在尝试跟踪,当使用以下技术使用 Windows 服务打开特定的 Word 文件但这些方法在 Windows 服务中不起作用时,请帮助我,提供我可以实现的方法。
1. Dim wordApp As Microsoft.Office.Interop.Word.Application
wordApp = Marshal.GetActiveObject("Word.Application")
Exception occurred: Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE))
--------------------------------------------------------------
2. Dim p() As Process = Process.GetProcessesByName("winword")
For Each a In p
FileRecord.WriteLine("Name : {0}", a.MainWindowTitle)
'Above Line Write empty a.MainWindowTitle
Next