Open Outlook's inbox with VBA

C

CES

All,
I'm trying to open Outlook 2007 (Vista) using VBA but unfortunately I can't seem to get it to work. I have found different variations of the following:

Dim Olook As Outlook.Application
Set Olook = CreateObject("Outlook.Application")
Olook.Application.Visible = True

but when I attempt to run the code I get a VB compile error: "user defined type not defined."

Basically what I want to do is to open Outlook and go to the inbox. If anyone can help me with this I would be grateful, Thanks in advance. - CES
 
M

Michael Bauer [MVP - Outlook]

The error occurs because Outlook is unknown to you project. Add a reference
to its library.

To make Outlook visible, add an Explorer to its Explorers collection.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?productid=300120654&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am Mon, 19 Mar 2007 19:28:06 -0400 schrieb CES:
All,
I'm trying to open Outlook 2007 (Vista) using VBA but unfortunately I
can't seem to get it to work. I have found different variations of the
following:
Dim Olook As Outlook.Application
Set Olook = CreateObject("Outlook.Application")
Olook.Application.Visible = True

but when I attempt to run the code I get a VB compile error: "user defined type not defined."

Basically what I want to do is to open Outlook and go to the inbox. If
anyone can help me with this I would be grateful, Thanks in advance. - CES
 
C

CES

Michael said:
The error occurs because Outlook is unknown to you project. Add a reference
to its library.

To make Outlook visible, add an Explorer to its Explorers collection.

Michael,
I'm sorry but I'm not sure what you mean when you y "Add a references to it's library... could you possible point me to a simple example of how to open Outlook from Any Office 2007 application. Thanks - CES
 

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

Top