![]() |
|
|
|
#1
|
|||
|
|||
|
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
Any suggestions? |
|
#2
|
||||
|
||||
|
The following will do that
Code:
Option Explicit
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim olInsp As Outlook.Inspector
Dim wdDoc As Object
Dim oRng As Object
With Item
Set olInsp = .GetInspector
Set wdDoc = olInsp.WordEditor
Set oRng = wdDoc.Range
oRng.Font.ColorIndex = &H0&
End With
lbl_Exit:
Set olInsp = Nothing
Set wdDoc = Nothing
Set oRng = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro to change font in email, dependent on which email account is being used
|
gb82 | Outlook | 2 | 01-23-2016 01:54 AM |
Send as PDF button in Word Body
|
wordJohn | Word | 1 | 03-24-2015 04:29 AM |
Format email body-Using Excel VBA to send mail
|
Claytocb | Excel Programming | 1 | 01-31-2013 11:58 PM |
Change font colour when tasks are completed
|
meileetan | Project | 3 | 09-12-2012 07:09 AM |
| Font Change when I send to Coworker | magictoaster | Word | 1 | 05-31-2012 02:16 PM |