Macro Email Variable

M

MikeSr

I currently use the following syntax for my email addres line in my macro:
=[forms]![Data Range]![Email Address] Where Data Range is my Form and Email
Address is a selected field from my combo box.
This works fine.
What is the correct syntax for the subject line and the message line?
I would like to establish the text from a fixed string programmaticly.
I hope this makes sense.
 
P

Piet Linden

I currently use the following syntax for my email addres line in my macro:
=[forms]![Data Range]![Email Address] Where Data Range is my Form and Email
Address is a selected field from my combo box.
This works fine.
What is the correct syntax for the subject line and the message line?
I would like to establish the text from a fixed string programmaticly.
I hope this makes sense.

easiest answer it not to use a macro, but to convert the macro to VBA
and then you have full control over all of that.
Never use macros, so the Subject line would be something like:

=[forms]![Data Range]![Subject]

and message would be similar
=[forms]![Data Range]![Message]
 
M

MikeSr

Thanks,
You are right. I am now using the Docmd.SendObject. Works much better.
How do you force a line feed in the "Message Text" portion of the "My
Message"?



Piet Linden said:
I currently use the following syntax for my email addres line in my macro:
=[forms]![Data Range]![Email Address] Where Data Range is my Form and Email
Address is a selected field from my combo box.
This works fine.
What is the correct syntax for the subject line and the message line?
I would like to establish the text from a fixed string programmaticly.
I hope this makes sense.

easiest answer it not to use a macro, but to convert the macro to VBA
and then you have full control over all of that.
Never use macros, so the Subject line would be something like:

=[forms]![Data Range]![Subject]

and message would be similar
=[forms]![Data Range]![Message]
 
M

MikeSr

I found the constant that works.
However, I can't seem to find how to change the first strings color.

DoCmd.SendObject acSendReport, "Alarms1", acFormatPDF, Email_Address, , ,
"Water Treatment ALARM", "CLARIFIER 1 High pH " & vbLf & "Please review the
attached report and look at the last entry for the alarm(s) along with the
date & timestamp.", False


MikeSr said:
Thanks,
You are right. I am now using the Docmd.SendObject. Works much better.
How do you force a line feed in the "Message Text" portion of the "My
Message"?



Piet Linden said:
I currently use the following syntax for my email addres line in my macro:
=[forms]![Data Range]![Email Address] Where Data Range is my Form and Email
Address is a selected field from my combo box.
This works fine.
What is the correct syntax for the subject line and the message line?
I would like to establish the text from a fixed string programmaticly.
I hope this makes sense.

easiest answer it not to use a macro, but to convert the macro to VBA
and then you have full control over all of that.
Never use macros, so the Subject line would be something like:

=[forms]![Data Range]![Subject]

and message would be similar
=[forms]![Data Range]![Message]
 

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