2012-07-13 104 views
1

當我嘗試初始化對象爲:初始化OutlookEmail對象給出了從HRESULT異常:0x80029C4A(TYPE_E_CANTLOADLIBRARY)

OutlookEMail email = new OutlookEMail(MailType); 
在C#

我得到異常:

Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' 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: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

使用Microsoft Office(前景)2007 有人可以幫助解決這個問題嗎?我在這個確切的同樣的錯誤

+0

看起來你錯過了一個DLL,或者它是你係統的錯誤格式。 – AlG 2012-07-13 11:24:36

+0

which exactly dll – Edgar 2012-07-13 11:27:24

+0

查看[ApplicationClass的文檔](http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.applicationclass.aspx)它應該有幫助 – AlG 2012-07-13 11:34:13

回答

0

,只有它,當我跑的代碼最簡單的路線:

var outlookApp = new Microsoft.Office.Interop.Outlook.Application(); 

我嘗試了各種修正建議像運行「修復」和註冊的各種組件。解決的辦法是將我的項目目標從「任何CPU」改爲「x86」。我在32位Office上運行Windows 8.1 64位。