?
Solved

Getting error while compile

Posted on 2013-01-16
3
Medium Priority
?
246 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 34

Accepted Solution

by:
Norie earned 1000 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 1000 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

Industry Leaders: 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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

762 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