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
Microsoft ActiveX Data Objects 2.1 Library
and am running (fragment here), as seen in microsoft knowledge how-to article.
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)
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.