473,804 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with calling Outlook

When I run this line:

myolApp = CreateObject("O utlook.Applicat ion")

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

I'm referencing the Outlook 10.0 Object Library (Interop.Outloo k), which
list the version as 9.1 in the properties window. The
Interop.Microso ft.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 1386
This might help you:

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

chanmm
"Brett" <no@spam.net> wrote in message
news:u5******** ******@TK2MSFTN GP14.phx.gbl...
When I run this line:

myolApp = CreateObject("O utlook.Applicat ion")

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

I'm referencing the Outlook 10.0 Object Library (Interop.Outloo k), which
list the version as 9.1 in the properties window. The
Interop.Microso ft.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.Applica tion = New Outlook.Applica tion()

I hope this helps.
"Brett" wrote:
When I run this line:

myolApp = CreateObject("O utlook.Applicat ion")

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

I'm referencing the Outlook 10.0 Object Library (Interop.Outloo k), which
list the version as 9.1 in the properties window. The
Interop.Microso ft.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.Offic e.Interop.Outlo ok as a reference now, just as
the article uses but still get the invalidcast error.

Brett

"chanmmn" <ch*****@hotmai l.com> wrote in message
news:ef******** ******@tk2msftn gp13.phx.gbl...
This might help you:

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

chanmm
"Brett" <no@spam.net> wrote in message
news:u5******** ******@TK2MSFTN GP14.phx.gbl...
When I run this line:

myolApp = CreateObject("O utlook.Applicat ion")

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

I'm referencing the Outlook 10.0 Object Library (Interop.Outloo k), which
list the version as 9.1 in the properties window. The
Interop.Microso ft.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

"Crouchie19 98" <Cr**********@d iscussions.micr osoft.com> wrote in message
news:39******** *************** ***********@mic rosoft.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.Applica tion = New Outlook.Applica tion()

I hope this helps.
"Brett" wrote:
When I run this line:

myolApp = CreateObject("O utlook.Applicat ion")

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

I'm referencing the Outlook 10.0 Object Library (Interop.Outloo k), which
list the version as 9.1 in the properties window. The
Interop.Microso ft.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
2371
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 'remember password' selection, however I cannot seem to figure out how to store the actual password. I have researched for many hours now, and am at a loss. I have found that the password is actually stored in the following registry key:
7
5419
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? I find no list of TOPICS to use with the DDE related commands in Access Basic or VBA
23
3296
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 to create certain textboxes, labels, and combo boxes? Any ideas would be appreciated. Thanks
13
3712
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 http://www.opennetcf.org/forums/post.asp?method=ReplyQuote&REPLY_ID=3922&TOPIC_ID=2224&FORUM_ID=35
8
1779
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 selectcommand button), i assign some session variables and perform a rediect to a "more information" page. Neither page is using Output Caching. On the more information page, a button reads "new search". this clears the session variables i set in...
10
3686
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. How can I do this?
7
1379
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
2148
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 normally. If I call my webservice then shutdown Outlook, Outlook doesnt shutdown properly and still lingers in memory (seen in the task manager). Below is my code for calling my webservice, is there anything I am doing wrong to clean up the...
2
3882
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 moyosoft(.com) where you can build java application with loutlook client content. According to moyosoft you can only use the java classes when the java application and oulook are running on the same system. Now I'am looking for a way to call outlook...
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10594
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10331
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5667
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.