View Single Post
 
Old 06-30-2016, 08:02 AM
RealmOfCOnfusion RealmOfCOnfusion is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Jun 2016
Posts: 1
RealmOfCOnfusion is on a distinguished road
Default VBA to change font colour in email body on send

With the help of some Excel VBA gurus I've managed to get some code that changes a specific font colour in the body of any email to black before the email is sent.

(Background: We have an employee who is dyslexic and finds it much easier to read characters on screen when the font colour is set to pink, so this code - see below - changes that specific colour to black when the user clicks on Send).

Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    If TypeName(Item) <> "MailItem" Then Exit Sub
    Item.HTMLBody = Replace(Item.HTMLBody, "#FF0066", "#000000", Compare:=vbTextCompare)
End Sub
This works fine, but she's now advised that she sometimes likes to amend the font colour from time to time (she seems to have some sort of variable dyslexia!), so what I need is something to change all of the text in the body of the email to black, rather than just replacing the one specific colour which is what the code above does.

Any suggestions?
Reply With Quote