Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    USA
    Posts
    24

    Unhappy Unanswered: User-defined type not defined -- outlook.application

    Another newbie question. I am trying to use automation to send an email message. I have referenced in this order:

    Visual Basic for Applications
    Microsoft Access 9.0 Object Library
    OLE Automation
    Microsoft ActiveX Data Objects 2.1 Library

    and am running (fragment here), as seen in microsoft knowledge how-to article.
    -----------
    Sub SendMessage()
    Dim objOutlook As Outlook.Application
    Dim objOutlookMsg As Outlook.MailItem
    Dim objOutlookRecip As Outlook.Recipient
    Dim objOutlookAttach As Outlook.Attachment

    ' Create the Outlook session.
    Set objOutlook = CreateObject("Outlook.Application")

    ' Create the message.
    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
    etc.
    ------------
    I get the message
    Compile Error: User-Defined type not defined and the

    Dim objOutlook as Outlook.Application

    line is highlighted.

    The documentation says make sure Microsoft Outlook 9.0 Object library is referenced, which it is.

    What am I doing wrong?

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    it's the reference to Microsoft Outlook library that is missing.

    I have referenced in this order:

    Visual Basic for Applications
    Microsoft Access 9.0 Object Library
    OLE Automation
    Microsoft ActiveX Data Objects 2.1 Library
    izy
    Last edited by izyrider; 09-11-03 at 04:45.

  3. #3
    Join Date
    Sep 2003
    Location
    USA
    Posts
    24
    Doh! Thanks!!! I missed it in my frustration.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •