Solved

Getting error while compile

Posted on 2013-01-16
3
244 Views
Last Modified: 2013-01-17
Hi Exparts,

I have a Access DB, while I compile it giving me the following error:
"User-defined type not defined"
Compile error occured in the following line:

Dim myOlApp As Outlook.Application

I am using office 2010, I am not sure if I am missing any reference, if so which reference.

Please advise.

Thanks
0
Comment
Question by:alam747
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 33

Accepted Solution

by:
Norie earned 250 total points
ID: 38785537
You need a reference to Microsoft Outlook x.0 Object Library.

x will depend on your version of Outlook, eg fot Outlook 2010 it's 14.0.
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 250 total points
ID: 38785759
Or use Late Binding so you don't have to worry about the Reference:

Example:

  Dim oOutlook As Object

  Set oOutlook= CreateObject("Outlook.Application")

See these KBs for more info:

Using early binding and late binding in Automation
http://support.microsoft.com/kb/245115

Late Binding in Microsoft Access
http://www.granite.ab.ca/access/latebinding.htm

mx
0
 

Author Closing Comment

by:alam747
ID: 38790589
Thanks a lot
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question