Formatting Text within an email

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

How can I format (Font, bold, font size, font color in an email sent from
access).

Here is some example code I have:
------------------------------------------------------------------------------------------------
Private Sub txtEmail_Click()

Dim InternalEmail As String
Dim AgendaDate As String
Dim Subject As String
Dim ReferenceID As String
Dim CategoryText As String
Dim CodeNumber As String
Dim ReviewTime As String
Dim MAPDandPDP As String
Dim Material As String




stDocName = "frmCommitteeEmail"
DoCmd.OpenForm stDocName, , , stLinkCriteria




InternalEmail = Forms!frmCommitteeEmail!DMEmail
AgendaDate = Forms!frmmain!AgendaDate
ReferenceID = Me.ReferenceID
CategoryText = Me.CategoryText
CodeNumber = Me.CodeNumber
ReviewTime = Me.ReviewTime
MAPDandPDP = Me.MAPDandPDP
Material = Me.Material


Subject = AgendaDate & " " & "-" & " " & ReferenceID

Message = vbLf & _
"Dear Review Committee" & vbLf & vbLf & _
"Please review the attached." & vbLf & vbLf & _
"Reference:" & " " & ReferenceID & vbLf & _
"Functional Area:" & " " & CategoryText & vbLf & _
"Code:" & " " & CodeNumber & vbLf & _
"Review Time:" & " " & ReviewTime & vbLf & _
"Materal:" & " " & Material & vbLf & _
"Purpose" & " " & MAPDandPDP & vbLf & _
"Please review the attached Material." & vbLf & vbLf & _
"Please review the attached Material." & vbLf & vbLf & _
"If you have any questions regarding this program, please contact your
Marketing Communications Representative."



On Error Resume Next
DoCmd.SendObject , "", "", InternalEmail, "", "", Subject, Message, True


DoCmd.Close acForm, "frmCommitteeEmail", acSaveYes

End Sub
----------------------------------------------------------------------------------------
So for example - How can I make "Review Time(ReviewTime) both BOLD and RED?

Any help here will be appreciated.

Thanks in advance
 
Dave said:
How can I format (Font, bold, font size, font color in an email sent
from access).

You can't do any of that with the built in SendObject command. You would
have to automate an external mesaging library like Outlook or CDO and then
use the HTML body populated with HTML content.
 
:( :(
That was not the answer I was hoping for.

Thanks for the reply.

How dificult is "automate an external mesaging library like Outlook or CDO
and then
use the HTML body populated with HTML content."

I know HTML well enough to format.

Dave
 
Dave said:
:( :(
That was not the answer I was hoping for.

Thanks for the reply.

How dificult is "automate an external mesaging library like Outlook
or CDO and then
use the HTML body populated with HTML content."

I know HTML well enough to format.

If you Google on the topic you should find samples you can include in your
app. As with many such things the code might look intimidating, but USING
it is often not difficult at all.

If you like I can send you an Access 2000 file that has an example class for
using CDO. I prefer that for messages that do not require the user to
view/edit them first and for which the recipients can be supplied by the
code.
 
I am not sure what a CDO is.
The user will be using Outlook as a miil client.
and as you mentioned recipents are supplied by the code.
however - if I can figure it out there will be attachments also.

If that senero soulds like your file will help I would love to take a look.
(I assume it will work in Access 2003 also)

Thanks much,

Dave
 
Dave said:
I am not sure what a CDO is.
The user will be using Outlook as a miil client.
and as you mentioned recipents are supplied by the code.
however - if I can figure it out there will be attachments also.

If that senero soulds like your file will help I would love to take a
look. (I assume it will work in Access 2003 also)

Thanks much,

CDO stands for Collaboration Data Objects (formerly called Active
Messaging). Here is a decent explanation
http://en.wikipedia.org/wiki/Collaboration_Data_Objects

The messaging library I use is called CDOSys and it exists on any Windows
2000 or newer PC so you don't have to install anything. When sending
messages this way Outlook is not involved so you don't get the annoying
security prompts that occur when you automate Outlook. It also means that
sent messages do not appear in the users Sent Mail folder. When that is a
problem I just BCC hte sender so that they get a copy.

I will send you the sample file.
 
Dave said:
I am not sure what a CDO is.
The user will be using Outlook as a miil client.
and as you mentioned recipents are supplied by the code.
however - if I can figure it out there will be attachments also.

If that senero soulds like your file will help I would love to take a
look. (I assume it will work in Access 2003 also)

Please send me an Email with your working EMail address and I will send you
the file.
 
Back
Top