Using/Registering the Outlook Object

  • Thread starter charlie oppenheimer
  • Start date
C

charlie oppenheimer

I'm sure there's something obvious I'm missing here.

I'm trying to use Outlook from within Word VBA. The declarations code
includes:
Dim oOutlook As Outlook.Application
Dim oMAPI As Outlook.NameSpace
Dim oFolder As Outlook.MAPIFolder
Dim oMailItem As Outlook.MailItem
Dim oRecipient As Outlook.Recipient

Set oOutlook = New Outlook.Application

I immediately get a compile error: "User Defined Data Type Not Defined"

Is there some way I need to be registering Outlook so VBA can find these
objects?

Thanks!
Charlie
 
D

Doug Robbins - Word MVP

You need to set a reference under Tools>References in the Visual Basic
Editor to the Microsoft Outlook [Version Number] Object Library.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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