473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with calling Outlook

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
Nov 21 '05 #1
4 1367
This might help you:

http://msdn.microsoft.com/library/de...OLOMwVBNET.asp

chanmm
"Brett" <no@spam.net> wrote in message
news:u5**************@TK2MSFTNGP14.phx.gbl...
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

Nov 21 '05 #2
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.
"Brett" wrote:
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

Nov 21 '05 #3
I'm including Microsoft.Office.Interop.Outlook as a reference now, just as
the article uses but still get the invalidcast error.

Brett

"chanmmn" <ch*****@hotmail.com> wrote in message
news:ef**************@tk2msftngp13.phx.gbl...
This might help you:

http://msdn.microsoft.com/library/de...OLOMwVBNET.asp

chanmm
"Brett" <no@spam.net> wrote in message
news:u5**************@TK2MSFTNGP14.phx.gbl...
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


Nov 21 '05 #4
I tried that but still get the same invalidcast error.

Any other suggestions?

Thanks,
Brett

"Crouchie1998" <Cr**********@discussions.microsoft.com> wrote in message
news:39**********************************@microsof t.com...
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.
"Brett" wrote:
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

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Jon | last post by:
Hello all, Trying to write an application for my workplace that requires us to setup an email account in Outlook Express. At this time, the app sets the account up, enters a username, sets the...
7
by: MLH | last post by:
Is the following remotely correct? =DDE("C:\Program Files\Program Files\Outlook Express\OEmig50","Attachment","Name") I'm not sure that OEmig50.exe is the executable for OE. Anybody know? ...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
13
by: Chua Wen Ching | last post by:
Hi there, I saw this article here in vb.net. http://www.error-bank.com/microsoft.public.dotnet.languages.vb.1/148992_Thread.aspx and ...
8
by: Elliot M. Rodriguez | last post by:
I am having a heckuva time debugging this, or determining why my page is behaving this way. I have a search form, that when completed, returns a datagrid. When the user selects a row (normal...
10
by: One Handed Man [ OHM ] | last post by:
If this is duplicated, I'm sorry because I cant find the original post I made today Anyway . . Now its my turn to ask a question I want to develop an app which will run in the system tray....
7
by: John | last post by:
Hi I have two distinct classes A & B. I am using class B from within Class A as follows; Public Class clsClassA Friend ClassB As new ClassB Public Sub New()
1
by: David | last post by:
Hi All, I am having trouble cleaning up after creating/calling my webservice (WSE1.0) from COM Addin that I create for Outlook. If I shutdown Outlook with using my webservice, Outlook shutsdown...
2
by: rmiddelburg | last post by:
Hi, I'am looking for a way to call a local dll in my java application. At the moment I'am building a contact portal and I want to receive information from outlook. I found the outlook api from...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.