我建立WCF的解決方案有關使用MS-Word 2003的API(的Microsoft.Office.Interop.Word)報告,但我得到這個錯誤:在WCF錯誤中創建MS-Word 2003?
2010-09-17 16:31:39,218 [21] ERROR ERROR [(null)] - Error : Generate 0900000a80395799
System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.CustomMarshalers.EnumeratorViewOfEnumVariant.MoveNext()
at FactoryService.Generator.Generate(Task& task, IDfSession& mySession)
at FactoryService.Generator.Generate(Object t)
2010-09-17 16:31:49,578 [22] ERROR ERROR [(null)] - Error generator timeout 0900000a80395799
2010-09-17 16:31:49,812 [14] ERROR ERROR [(null)] - Error : Generate 0900000a80395799
System.Runtime.InteropServices.COMException (0x800706BF): The remote procedure call failed and did not execute. (Exception from HRESULT: 0x800706BF)
at Microsoft.Office.Interop.Word.ApplicationClass.get_Documents()
at FactoryService.Generator.Generate(Task& task, IDfSession& mySession)
at FactoryService.Generator.Generate(Object t)
2010-09-17 16:31:50,046 [18] ERROR ERROR [(null)] - Error : Generate 0900000a80395799
System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
at Microsoft.Office.Interop.Word.ApplicationClass.get_Documents()
at FactoryService.Generator.Generate(Task& task, IDfSession& mySession)
at FactoryService.Generator.Generate(Object t)
2010-09-17 16:31:50,968 [22] ERROR ERROR [(null)] - Error generator timeout 0900000a80395799
2010-09-17 16:31:50,984 [10] ERROR ERROR [(null)] - Error : Generate 0900000a80395799
System.Runtime.InteropServices.COMException (0x800706BE): The remote procedure call failed. (Exception from HRESULT: 0x800706BE)
at Microsoft.Office.Interop.Word.Documents.Open(Object& FileName, Object& ConfirmConversions, Object& ReadOnly, Object& AddToRecentFiles, Object& PasswordDocument, Object& PasswordTemplate, Object& Revert, Object& WritePasswordDocument, Object& WritePasswordTemplate, Object& Format, Object& Encoding, Object& Visible, Object& OpenAndRepair, Object& DocumentDirection, Object& NoEncodingDialog, Object& XMLTransform)
at FactoryService.Generator.Generate(Task& task, IDfSession& mySession)
at FactoryService.Generator.Generate(Object t)
我不知道爲什麼這個API調用RPC服務並且它支持Word2003中併發發生在Web服務器上
感謝事先在服務器端(無UI)
「如果還有其他問題......」將會出現。當沒有UI時,Word不會改變其工作方式,並且如果它嘗試用對話框詢問用戶的問題,則應用程序將被鎖定,因爲沒有人會看到它。此外,很多時候它不會優雅地關閉,並且會保留在內存中,浪費資源直到您的Web服務器或Windows服務關閉,等等......僅在客戶端使用自動化......但只有當沒有其他方法時! – jmservera 2010-09-20 11:26:15
是的,同意......總有一種解決方法 - 例如,我們手動殺死了文字處理等等......但正如你所說的,沒有辦法與GUI對話框交互(有,但那會太多),這就是我們放棄自動化的最終原因。我建議切換到WordprocessingML以及... – veljkoz 2010-09-20 16:38:21
-1建議使用任何類型的服務的Word。 – 2010-11-22 20:29:45