manoj kumar

manoj kumar

  • NA
  • 8
  • 0

invalidCast expetion

Jun 3 2008 11:41 PM

Hi,

i have vb.net application. That is working with outlook.

here is code:

Dim OL As New Microsoft.Office.Interop.Outlook.Application

Dim ns As Microsoft.Office.Interop.Outlook.NameSpace = OL.GetNamespace("MAPI")

2nd line is thowring following exception

 

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: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).

 

 

I am using office 2003 & VS 2005.

 

Thanks