472,131 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Type Outlook.Application is not defiined

I am getting "Type Outlook.Application is not defined" on the line:

Dim olApp as New Outlook.Application()

I have added a reference to Outlook 11.0 Object Library, but the error is
still happening
Nov 21 '05 #1
6 20340
Hi,

Try interop.outlook.application

Ken
-----------------------
"Jonathan Smith" <Jo***********@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
I am getting "Type Outlook.Application is not defined" on the line:

Dim olApp as New Outlook.Application()

I have added a reference to Outlook 11.0 Object Library, but the error is
still happening
Nov 21 '05 #2
Try adding the following import:

Imports Outlook = Microsoft.Office.Interop.Outlook
Nov 21 '05 #3
now get "type interop.outlook.application is not defined"

"Ken Tucker [MVP]" wrote:
Hi,

Try interop.outlook.application

Ken
-----------------------
"Jonathan Smith" <Jo***********@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
I am getting "Type Outlook.Application is not defined" on the line:

Dim olApp as New Outlook.Application()

I have added a reference to Outlook 11.0 Object Library, but the error is
still happening

Nov 21 '05 #4
Jonathan,

"Jonathan Smith" <Jo***********@discussions.microsoft.com> schrieb:
I am getting "Type Outlook.Application is not defined" on the line:

Dim olApp as New Outlook.Application()

I have added a reference to Outlook 11.0 Object Library, but the error is
still happening


Make sure you have a project-wide import for 'Microsoft.Office.Interop', or
'Imports Microsoft.Office.Interop' on top of the file containing the source
code.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #5
I had this same problem. The way that i fixed this problem is by
reinstalling office will all options. I beleive that something is not being
installed which is causing the outlook interop to crash. I am not sure about
this.
But like I said reinstalling Office will all options fixed this problem.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:ej**************@TK2MSFTNGP09.phx.gbl...
Jonathan,

"Jonathan Smith" <Jo***********@discussions.microsoft.com> schrieb:
I am getting "Type Outlook.Application is not defined" on the line:

Dim olApp as New Outlook.Application()

I have added a reference to Outlook 11.0 Object Library, but the error is
still happening


Make sure you have a project-wide import for 'Microsoft.Office.Interop',
or 'Imports Microsoft.Office.Interop' on top of the file containing the
source code.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #6
Jonathan,
Do you have the Outlook PIA installed?

The Outlook PIA is an optional install when you install Outlook 11, you need
to specifically install it.

Then as the Herfried & the others suggest you need either a project wide or
file specific import.
For a list of articles on using Outlook from .NET see:

http://www.microeye.com/resources/res_outlookvsnet.htm

For a plethora of automating Outlook with VBA, VB6, and VBScript see:
http://www.outlookcode.com/

To avoid the Outlook security prompts its generally easiest to create a
properly constructed COM-Addin for Outlook 2003. There are other methods
available for other versions of Outlook...

See:
http://msdn.microsoft.com/library/de...scomaddins.asp

Further info can be found at:
http://www.slipstick.com/dev/ol2003problems.htm
http://www.slipstick.com/outlook/esecup/admin.htm

The links I gave have samples of creating add-ins.

Both of these are good articles to start with:
http://msdn.microsoft.com/library/de...addinvbnet.asp

http://support.microsoft.com/?kbid=302896

Also, be certain you have explicitly installed the Outlook PIAs! The Outlook
2003 PIAs are an optional install, while the Outlook XP PIA is a download.

Hope this helps
Jay
"Jonathan Smith" <Jo***********@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
I am getting "Type Outlook.Application is not defined" on the line:

Dim olApp as New Outlook.Application()

I have added a reference to Outlook 11.0 Object Library, but the error is
still happening

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by PIKACHU | last post: by
10 posts views Thread by John | last post: by
16 posts views Thread by Dennis | last post: by
5 posts views Thread by PJ6 | last post: by
reply views Thread by leo001 | last post: by

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.