S
Susan L
I think my earlier post got lost. I have "cobbled together" some code that I
have found in these newsgroups to try to get Access to autofill an Outlook
subject line with a value on a control on a form. The control is called
"Identifier." I created a button (via wizard) to run a macro that was set up
using the SendObject command. I used this button code as a shell to insert
the following. I am getting a compile error " User-defined type not defined."
What is then highlighted is the first line regarding Outlook. Can anyone
help? I'd sure appreciate it, as I'm no expert!
Here's the code:
Private Sub cmdSend_Click()
On Error GoTo Err_cmdSend_Click
Dim objOutlook As Outlook.Application
Dim ojbEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
SetobjEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.Subject = Me!Identifier
End With
Exit_cmdSend_Click:
Exit Sub
Err_cmdSend_Click:
MsgBox Err.Description
Resume Exit_cmdSend_Click
End Sub
have found in these newsgroups to try to get Access to autofill an Outlook
subject line with a value on a control on a form. The control is called
"Identifier." I created a button (via wizard) to run a macro that was set up
using the SendObject command. I used this button code as a shell to insert
the following. I am getting a compile error " User-defined type not defined."
What is then highlighted is the first line regarding Outlook. Can anyone
help? I'd sure appreciate it, as I'm no expert!
Here's the code:
Private Sub cmdSend_Click()
On Error GoTo Err_cmdSend_Click
Dim objOutlook As Outlook.Application
Dim ojbEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
SetobjEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.Subject = Me!Identifier
End With
Exit_cmdSend_Click:
Exit Sub
Err_cmdSend_Click:
MsgBox Err.Description
Resume Exit_cmdSend_Click
End Sub