Help with calling Outlook

  • Thread starter Thread starter Brett
  • Start date Start date
B

Brett

When I run this line:

myolApp = CreateObject("Outlook.Application")

The myolApp object has a value of {Outlook.ApplicationClass}. When I expand
it in the watch window, all properties/methods of that object have a value
of
<error: an exception of type: {System.InvalidCastException} occured>

I'm referencing the Outlook 10.0 Object Library (Interop.Outlook), which
list the version as 9.1 in the properties window. The
Interop.Microsoft.Office.Core 2.2 reference is also there.

Does any one know what causing this error and a possible solution?

Using VB .NET 2003 with .NET 1.1 framework.

Thanks,
Brett
 
Declare it this way instead & see if you still get the same error making sure
you have the Outlook 10 Object Library referenced:

Dim objOutlook As Outlook.Application = New Outlook.Application()

I hope this helps.
 
I'm including Microsoft.Office.Interop.Outlook as a reference now, just as
the article uses but still get the invalidcast error.

Brett
 
I tried that but still get the same invalidcast error.

Any other suggestions?

Thanks,
Brett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top