email in body not an attachment?

G

Guest

I would like to generate an email with a single record or just a couple of
fields from that record in an outlook email.
Is this possible, I know I can open outlook and have an attachment of all
records in my form, but I need just a sing record (the one being viewed)
inserted in the body of my email not an attachment. Appreciate any help
 
G

Guest

One option would be to use the DoCmd.SendObject Method

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

You can create a string with all the information you wish from the record
and then pass it to the Method as the MessageText. For more info look it up
in the help there is a good example.
 
T

Tony Toews [MVP]

Robert said:
I would like to generate an email with a single record or just a couple of
fields from that record in an outlook email.
Is this possible, I know I can open outlook and have an attachment of all
records in my form, but I need just a sing record (the one being viewed)
inserted in the body of my email not an attachment.

To create a formatted document to send as an email you will need to
use VBA code to create a largish string. This string will then be
passed to the SendObject command or other method as the body of the
email. For more details including sample air code see my Tips page
on this topic at http://www.granite.ab.ca/access/email/formatted.htm.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
G

Guest

the only choices i see for output format are files. excel,pdf,rtf,txt.. i
need in body of email
 
R

Rick Brandt

Robert said:
the only choices i see for output format are files. excel,pdf,rtf,txt.. i
need in body of email

You can build up a long string variable and use that for a plain text body.
Otherwise you cannot use SendObject. You would need to automate a messaging
library (Outlook, CDO, etc.).
 
T

Tony Toews [MVP]

Robert said:
i tried your link with no luck, your link is not working, i tried
www.granite.ab.ca also with no luck, i want to see your example. thanks for
your help.

My web server was down over night. Should be working fine now.

We have to give it a kick every once in a while.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

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