Emailing Access generated report automatically

Posted on 2012-09-19
Last Modified: 2012-09-20
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?
Question by:uad
    LVL 84

    Assisted Solution

    by:Scott McDaniel (Microsoft Access MVP - EE MVE )
    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.
    LVL 6

    Accepted Solution

    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.

    Author Closing Comment

    Both solutions answered the question, but fhlio_admin when the extra step and gave me the info to find and fix the library.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    Set OWA language and time zone in Exchange for individuals, all users or per database.
    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now