Auto-enter info from a record in an Outlook Subject line

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top