2013-07-23 85 views
0

嘗試自動生成通過Outlook郵件消息 -的Outlook互操作異常 - 顯示新的MailItem

加入Microsoft.Office.Interop.Outlook 14.0.0.0

參考它可以在一個雙贏8 /辦公2013 PC,但失敗在Win 7 /辦公以下異常2010

代碼:

Application outlookApp = new Application(); 
MailItem message = (MailItem)outlookApp.CreateItem(OlItemType.olMailItem); 
message.Subject = "subject"; 
message.Display(message); 
message.HTMLBody = "body" + message.HTMLBody; //to get default signature 

唯一的例外是:

Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).

+0

例外是給出了很多關於如何解決它的信息。你有沒有看過(TYPE_E_LIBNOTREGISTERED)? – Jonesopolis

回答

0

解決方案結束了:

http://www.fieldstonsoftware.com/support/support_gsyncit_2013.shtml

的Lync 2013上安裝了Office 2010的頂部。這增加了一個註冊表項HKCR \ {類型庫00062FFF-0000-0000-C000-000000000046} 。

該註冊表項的子項將爲不同編號的文件夾,指示安裝的Office的版本號。 (在這種情況下,9.4表示2010,9.5表示2013)。一旦與Outlook版本不一致的版本號被刪除,它就被解決了。

+0

僅鏈接的答案在這裏不受歡迎。請總結一下這個鏈接。 –

相關問題