Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format email from Access

Status
Not open for further replies.

jw5107

Technical User
Jan 20, 2004
294
US
Is there a way to change the font color and/or make font bold when generating an email from access..? I have searched and searched - but no help...!! Can't find anything..!! Is this one of those funky add-in's I need or something...?
Any suggestions...?? Or examples...??
Below is code I am working with. Just need to make the fields from the form show up in bold font or different colors in the body of the email message...!!!!
Thanks in advance!!
jw5107

Private Sub cmdEmail_Click()
Dim strBody As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

If Me!ChkEmail = False Then
DisplayMessage "You CAN NOT generate the email unless the Email Sent button is checked...!!!!"
ChkEmail.SetFocus
Exit Sub
Else

'**creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

strBody = strBody & "****IMPORTANT - ACTIONS REQUIRED****" & Chr(13) & Chr(10)
strBody = strBody & "****EMAIL CONFIRMATION - REQUIRED****" & Chr(13) & Chr(13)
strBody = strBody & "ATTN: " & Me!Allocations & "" & Chr(13) & Chr(13)
strBody = strBody & "Your station has been affected by a Shelf Life change of IID " & IID & ", " & UCase(CStr(Nz(Forms!SLMain!FleetEff, ""))) & ", " & UCase(CStr(Nz(Forms!SLMain!Description, ""))) & " , which includes P/N(s) " & UCase(CStr(Nz(Forms!SLMain!MPNs, ""))) & ". The following change in the Shelf Life Designation has occurred:" & Chr(13) & Chr(13)
strBody = strBody & "***Current Shelf Life Item: " & UCase(CStr(Nz(Forms!SLMain!CurSL, ""))) & Chr(13) & Chr(13)
strBody = strBody & "***Current Shelf Life Deteriorative Characteristic: " & UCase(CStr(Nz(Forms!SLMain!CurSLDef, ""))) & Chr(13) & Chr(13)
strBody = strBody & "***New Shelf Life Item: " & UCase(CStr(Nz(Forms!SLMain!NewSL, ""))) & Chr(13) & Chr(13)
strBody = strBody & "***New Shelf Life Deteriorative Characteristic: " & UCase(CStr(Nz(Forms!SLMain!NewSLDef, ""))) & Chr(13) & Chr(13)
strBody = strBody & "Please take note of this Shelf Life change. MIPS has been updated to reflect the new designation." & Chr(13) & Chr(10)
strBody = strBody & "Any questions or concerns - Please contact Data Base Management via email address " & LCase(CStr(Nz(Forms!SLMain!emailcontact, ""))) & " atlas 5-350-" & Me!Atlas & " and/or 502-" & Me!Phone & "." & Chr(13) & Chr(13)
strBody = strBody & "Regards," & Chr(13) & Chr(13)
End If

'***creates email
With objEmail
.Subject = "Shelf Life Change Notification- P/N(s) " & MPNs & " " & UCase(CStr(Nz(Forms!SLMain!Description, ""))) & ""
.Body = strBody
.VotingOptions = "Accept;Reject"
.Importance = olImportanceHigh
.VotingResponse = True
.Display
End With
Set objEmail = Nothing
End Sub
 
jw5107,
The only reliable option that I know of is to format the body of your message as HTML. You can change [tt]strBody[/tt] to include the formatting tags you want and then set the [tt]HTMLBody[/tt] of your email message.

There are numerous posts on this, try searching for HTMLBody.

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top