Formatting Question

S

Stan

I'm new to coding so please forgive my ignorance.

I'm needing to change a font color for the field [Employee Name] and a short
date format for the field [Exception Date] which appears in the message body
of an email via DoCmd.SendObject. I included a section of the code below.
If you can help I would appreciate it. Many thanks!

DLookup("[Employee Name]", "qryCommunication") & " " & DLookup("[Today's
Date]", "qryCommunication")
 
P

Pat Hartman

This will be pretty tricky. You would need to format the message body as
HTML or RTF and insert the correct codes to effect the formatting you want.
I am not sure that the SendObject method supports this so you'll have to
play around. To get a sense of what the text will need to look like, create
a short word document with similar formatting. Save the document as RTF and
again as HTML. Open the RTF document in notepad which will allow you to see
the formatting codes that Word inserted in the document. The same method
will show you the HTML codes.
 
S

Stan

Well I tried that without any luck. The email is being sent in HTML format.
When I opened the Word doc with Notepad it had many, many lines of code that
really made no sense. I thought that maybe it could be wrapped in something
like:
format([Employee Name]","qryCommunication").properties.font.220 but nothing
seems to work.

Pat Hartman said:
This will be pretty tricky. You would need to format the message body as
HTML or RTF and insert the correct codes to effect the formatting you want.
I am not sure that the SendObject method supports this so you'll have to
play around. To get a sense of what the text will need to look like, create
a short word document with similar formatting. Save the document as RTF and
again as HTML. Open the RTF document in notepad which will allow you to see
the formatting codes that Word inserted in the document. The same method
will show you the HTML codes.

Stan said:
I'm new to coding so please forgive my ignorance.

I'm needing to change a font color for the field [Employee Name] and a
short
date format for the field [Exception Date] which appears in the message
body
of an email via DoCmd.SendObject. I included a section of the code below.
If you can help I would appreciate it. Many thanks!

DLookup("[Employee Name]", "qryCommunication") & " " & DLookup("[Today's
Date]", "qryCommunication")
 

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