I used information from the Microsoft web site and from this forum to write VBA code last week to send email from Access using Outlook. The code is run when a user clicks on a "Send" button on a form. It worked fine for a few days.
Now when a user clicks on the "Send" button they receive the following error message:
"Compile error: User-defined type not defined."
The code is stopping at the first Dim statement in the subroutine. Here's the beginning of the subroutine:
I uploaded an upgrade for this application on Saturday so I think the problem is related to an upgrade I did on my system on Friday. As of this month I need to support both Access 2007 and Access 2003. On Friday I upgraded my system so that both versions of Microsoft Office are installed including Access although only Outlook 2007 is installed.
How do I change the code so that it compiles on my system and knows to look for Outlook 2003 on the user's sytem? Should I post the entire subroutine?
Deanna
Now when a user clicks on the "Send" button they receive the following error message:
"Compile error: User-defined type not defined."
The code is stopping at the first Dim statement in the subroutine. Here's the beginning of the subroutine:
Code:
Private Sub sbSendAwardCompletionRequest(Optional AttachmentPath)
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment
I uploaded an upgrade for this application on Saturday so I think the problem is related to an upgrade I did on my system on Friday. As of this month I need to support both Access 2007 and Access 2003. On Friday I upgraded my system so that both versions of Microsoft Office are installed including Access although only Outlook 2007 is installed.
How do I change the code so that it compiles on my system and knows to look for Outlook 2003 on the user's sytem? Should I post the entire subroutine?
Deanna