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!

Turn email body to color red 1

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
Below is code that I have that when a CheckBox is checked
an email is sent. This works real well. I have highlighted
in red the code that I would like to turn into the color
red in the email and I do not have a clue as how to
accomplish this.

Code:
Private Sub to_kanban_Click()

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

If Me.to_kanban = True Then
Me.from_kanban.Enabled = True
Else
Me.from_kanban.Enabled = False
End If

If Me.to_kanban = True Then
Me.KanbanIssue.Enabled = True
Else
Me.KanbanIssue.Enabled = False
End If

If Me.to_kanban = False Then
Me.KanbanIssue.Enabled = False
End If

If Me.to_kanban = True Then
'SendMail7
End If

'Private Sub PartsMove_Click()

       Dim O As Outlook.Application
       Dim m As Outlook.MailItem
       Dim toEmail1 As String
       Dim toEmail2 As String
       Dim ccEmail1 As String
       Dim ccEmail2 As String
       Dim ccEmail3 As String
       Dim bccEmail1 As String
       Dim SL As String, DL As String
       SL = vbNewLine
       DL = SL & SL

If Me.to_kanban = True Then
Set O = CreateObject("Outlook.Application")
Set m = Outlook.CreateItem(0)
toEmail1 = "absroger@nmhg.com; abrproct@nmhg.com; abrroger@nmhg.com"
ccEmail1 = "abkthomp@nmhg.com"
'ccEmail2 = DLookup("LoginName", "ChangeFormUserNameTbl", "ActualName='" & Me.EcnBomAnalystAssigned & "'") & "@nmhg.com"
ccEmail3 = ""
bccEmail1 = "abajacks@nmhg.com"

m.To = toEmail1
m.CC = ccEmail1
'm.CC = ccEmail1 & ";" & ccEmail2
m.BCC = bccEmail1
m.Subject = "Form #" & Me.Form__.Value & " Kanban Material is being added, deleted or moved."
m.Body = "Form #" & Me.Form__.Value & DL & _
      [COLOR=Red] "Request Date: " & Me.Date_Change.Value & SL & _
       "Due Date:       " & Me.soe_date_needed.Value & DL & _ [/Color]
       "Kanban Material is being added, deleted or moved:" & DL & _
       Me.What_Changed.Value & DL & _
       "Please Check all Material. If you have any questions Please contact Appropriate Engineer" & DL & _
       "Thank you," & SL & _
       DLookup("ActualName", "tblUserNameActualName", "UserName='" & GetCurrentUserName() & "'") & DL & _
       "Engineering"

m.Display
End If

End Sub
 
Use the HTMLbody property.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PH,

I have tried this code below and am getting
this in the body of my email. I must still
be doing something wrong.

Form #23899

<font color='#FF0000'>Request Date: 10/22/2008
Due Date: 11/10/2008

</font>Kanban Material is being added, deleted or moved:

Event 210 Remove 524220654
Event 40 Remove 524220653

Kanban notice Both parts are use up. After they are completely used up the location will no longer used and the requirement for the hyster panels will increase which already located in 9127. Hyster parts are 8543448 and 8543448. Once Yale parts are used up can replace with the hyster in that location if new demand dictates.

Please Check all Material. If you have any questions Please contact Appropriate Engineer

Thank you,
Allen Jackson

Engineering
Code:
Private Sub to_kanban_Click()

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

If Me.to_kanban = True Then
Me.from_kanban.Enabled = True
Else
Me.from_kanban.Enabled = False
End If

If Me.to_kanban = True Then
Me.KanbanIssue.Enabled = True
Else
Me.KanbanIssue.Enabled = False
End If

If Me.to_kanban = False Then
Me.KanbanIssue.Enabled = False
End If

If Me.to_kanban = True Then
'SendMail7
End If

'Private Sub PartsMove_Click()

       Dim O As Outlook.Application
       Dim m As Outlook.MailItem
       Dim toEmail1 As String
       Dim toEmail2 As String
       Dim ccEmail1 As String
       Dim ccEmail2 As String
       Dim ccEmail3 As String
       Dim bccEmail1 As String
       Dim SL As String, DL As String
       SL = vbNewLine
       DL = SL & SL
'SL = "<br>"
'DL = SL & SL

If Me.to_kanban = True Then
Set O = CreateObject("Outlook.Application")
Set m = Outlook.CreateItem(0)
toEmail1 = "absroger@nmhg.com; abrproct@nmhg.com; abrroger@nmhg.com"
ccEmail1 = "abkthomp@nmhg.com"
'ccEmail2 = DLookup("LoginName", "ChangeFormUserNameTbl", "ActualName='" & Me.EcnBomAnalystAssigned & "'") & "@nmhg.com"
ccEmail3 = ""
bccEmail1 = "abajacks@nmhg.com"
m.To = toEmail1
m.CC = ccEmail1
'm.CC = ccEmail1 & ";" & ccEmail2
m.BCC = bccEmail1
m.Subject = "Form #" & Me.Form__.Value & " Kanban Material is being added, deleted or moved."
m.Body = "Form #" & Me.Form__.Value & DL & _
"<font color='#FF0000'>Request Date: " & Me.Date_Change.Value & SL & _
"Due Date:       " & Me.soe_date_needed.Value & DL & "</font>" & _
"Kanban Material is being added, deleted or moved:" & DL & _
Me.What_Changed.Value & DL & _
"Please Check all Material. If you have any questions Please contact Appropriate Engineer" & DL & _
"Thank you," & SL & _
DLookup("ActualName", "tblUserNameActualName", "UserName='" & GetCurrentUserName() & "'") & DL & _
"Engineering"

m.Display
End If

End Sub

 
Replace this:
m.Body
with this:
m.HTMLBody

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top