• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 477
  • Last Modified:

Emailing Access generated report automatically

Although the same code works on another MS Access database, I am getting the following error which is baffling me.

For whatever reason:
Dim objOutlook As Outlook.Application is generating "Compile error:  User-defined type not defined"

Any suggestion what the issue is and how to correct it?
2 Solutions
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
In most cases this is caused by missing or invalid references. The database where the code is running needs a reference to the Microsoft Outlook library.
In the VBA window, go to Tools -> References.

In the list, find "Microsoft Outlook xx.0 Object Library".  The xx is the version that you have.  Likely, it will be 11-14.  It will NOT say 2003/2007/etc.

Check the references and hit the "OK" button.
uadAuthor Commented:
Both solutions answered the question, but fhlio_admin when the extra step and gave me the info to find and fix the library.

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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now