Adding cc, Subject and body to access generated email

G

Guest

good afternoon,

ui am sending an email through a command button via access switchboard. i
have it putting the email address on the (to) line... my question is how do i
put an email address on the cc line and add the subject and text "New
TechReq" in the body of the email?

thuis is the code i am cufrrently usung:
Private Sub Email_TechReq_Click()
On Error GoTo StartOutLook_Error

DoCmd.SendObject acSendNoObject, , , "derrick smith; bob johnson; lisa
jackson"

StartOutLook_Error:
If Err <> 2501 Then ' Ignore the error
MsgBox "Error: " & Err & " " & Error

End If

End Sub
 
R

Rick A.B.

good afternoon,

ui am sending an email through a command button via access switchboard. i
have it putting the email address on the (to) line... my question is how do i
put an email address on the cc line and add the subject and text "New
TechReq" in the body of the email?

thuis is the code i am cufrrently usung:
Private Sub Email_TechReq_Click()
On Error GoTo StartOutLook_Error

DoCmd.SendObject acSendNoObject, , , "derrick smith; bob johnson; lisa
jackson"

StartOutLook_Error:
If Err <> 2501 Then ' Ignore the error
MsgBox "Error: " & Err & " " & Error

End If

End Sub

If you look up the help on SendObject it shows you.

The SendObject method carries out the SendObject action in Visual
Basic.expression.
SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject,
MessageText, EditMessage, TemplateFile)
expression A variable that represents a DoCmd object.
 
G

Guest

I did see that in help, i'm just not sure how to apply it.

the code i have i found. i really appreciate your help.
 
R

Rick A.B.

I did see that in help, i'm just not sure how to apply it.

the code i have i found. i really appreciate your help.

DoCmd.SendObject acSendNoObject, , ,
"(e-mail address removed)","(e-mail address removed)",,"Subject Important
Message","Message Body",

Your best bet is for your form to have a text box for their email
address, a text box for the Cc, a text box with the Subject and a text
box for the Message. Then you can do,

DoCmd.SendObject acSendNoObject, , ,
txtEmail,txtCc,,txtSubject,txtMessage,

It gets more complecated if you want to email more than one person or
Cc to more than one person.
 

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