E-mail Code

N

Nick T

Hi,
I have a form which has a cmd button on it. The current code behind my cmd
button is as below. When my button is clicked, a window pops up asking me
the format i want to send my attachment file - ie, HTML, Text File, Rich Text
Format etc.
Questions:
1) Can i write into the code that i want the file format to be eg. HTML
2) Can i write into the code somthing which automatically sends the e-mail,
as opposed to just opening my e-mail, inserting the e-mail address and
attaching the file?
3) Can i write into the code somthing like emailsubject = "test test test"
and emailbody "hello hello" ??

My current code is:

Private Sub Command35_Click()
On Error GoTo Err_Command35_Click

Dim stDocName As String

stDocName = "Report1"
DoCmd.SendObject acReport, stDocName, , " '" & Forms!Email1!Email & "'"


Exit_Command35_Click:
Exit Sub

Err_Command35_Click:
MsgBox Err.Description
Resume Exit_Command35_Click

End Sub


Any help or suggestions greatly appreciated.

Many thanks
 
R

RonaldoOneNil

Yes to all 3 questions

DoCmd.SendObject acReport, stDocName, acFormatHTML, Forms!Email1!Email, , ,
"test test test", "hello hello", False
 
J

James A. Fortune

Yes to all 3 questions

RonaldoOneNil,

There are 10 kinds of people. Those who can count in binary and those
who can't? That joke is old. You need to come up with better
names :).

James A. Fortune
(e-mail address removed)
 

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