Help with SendObject

  • Thread starter Thread starter DevilDog1978
  • Start date Start date
D

DevilDog1978

I am trying to figure out how to add the current date to the subject line and
in the Message Text field. I am using Office 2003. I am thinking this might
have to be done using VBA...and I have no clue how to use VBA.
 
If you look at the help file regarding the sendobject method you will see the
available input variable to you.

SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject,
MessageText, EditMessage, TemplateFile)

As such, you control the Subject by manipulating the 7th input variable and
the Message with the 8th input variable.

I do not know exactly your need (simple e-mail, attaching report...) but
below is a simplified example you can start to work with.

sSubject = "Your subject line :: " & Format(Date, "yyyy-mmm-dd")
sMsg = "Your actual e-mail message " & Format(Date, "yyyy-mmm-dd")
DoCmd.SendObject acSendNoObject, , ,"(e-mail address removed)", , , sSubject,
sMsg

In the example above, I simply use the Format() in conjunction with the
Date() to add the date to the subject and/or message.

Are you wanting to send out an e-mail using a button on a form, or do you
have other needs?

If you need more help, post back.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
Back
Top