Send Email Without chance to edit in Outlook (1 Viewer)

Crazy

Registered User.
Local time
Today, 10:08
Joined
Aug 2, 2001
Messages
14
I have a code to automatically send e-mails to certain e-mail addresses:

Private Sub cmdSendMail_Click()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("sorting")

Do While Not rsEmail.EOF
strEmail = rsEmail.Fields("EmailAddress").Value
DoCmd.SendObject , , , strEmail, , , "NCFC Fanzine Subscription", "Our records show that your subscription is due for renewal, please fill in the form at this web address to renew,yours sincerly,The Editor"

rsEmail.MoveNext

Loop
Set rsEmail = Nothing
MsgBox "Emails have been sent to all subscribers that need to update there subscription"

End Sub

however i would like NOT to be given the oppurtunity to edit the messasge in outlook, any easy way to do this?

Just as an extra, how do i format the message text in a more appropriate way (make it go on more than one line!)

cheerz!
 

shacket

Registered User.
Local time
Today, 10:08
Joined
Dec 19, 2000
Messages
218
To get the e-mail to send without editing, it is one of the last variables for the SendObject function. Look at SendObject under help files (I don't have Access in front of me or I would give you the exact code).

To add a line to the e-mail, put the following in your text:

"This would go on line 1" & Chr(13) & "This would be on the next line."

HTH
 

rich.barry

Registered User.
Local time
Today, 10:08
Joined
Aug 19, 2001
Messages
176
Probably Chr$(13) by itself won't be enough.

You need a line feed Chr$(10) + a carriage return Chr$(13).
VB has constants defined for these
vbLf, vbCr and vbCrLf, which are quicker than typing the Chr$ stuff.
 
D

dennis g

Guest
The last option should either be True of False. True opens the Outlook window, False send the item without opening the Outlook window. Like this:

DoCmd.SendObject , , , "BB.OPR.Resource.Protection.Military Movements", stString, , _
"MILITARY MOVEMENT: " & Me.file_number, "SHIPPER: " & Me.shipper & vbCrLf & vbCrLf & "FILE: " & Me.file_number & vbCrLf & "ROUTING:" & Me.routing & vbCrLf & vbCrLf & "LADING: " & Me.lading & vbCrLf & _
"LOAD(S): " & Me.load & vbCrLf & "ORIGIN: " & Me.origin & vbCrLf & "DESTINATION: " & Me.destination & vbCrLf & vbCrLf & "TRACKING HISTORY: " & vbCrLf & Me.history, True
 

Users who are viewing this thread

Top Bottom