Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 05-04-2020, 03:30 PM
macropod's Avatar
macropod macropod is offline Find and change the background color of certain keywords Windows 7 64bit Find and change the background color of certain keywords Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,520
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

There is no such property as:
.Font.HighlightColorIndex = wdBlack
Moreover, you can't set the HighlightColorIndex that way via Find/Replace. You need to use something like:
Code:
Options.DefaultHighlightColorIndex = wdBlack
With ActiveDocument.Content.Find
  .ClearFormatting
  .Font.Shading.BackgroundPatternColor = RGB(235, 214, 214)
  With .Replacement
    .ClearFormatting
    .Font.Bold = True
    .Font.ColorIndex = wdWhite
    .Font.Shading.BackgroundPatternColor = RGB(0, 0, 0)
    .Highlight = True
  End With
  .Execute FindText:="", ReplaceWith:="", Format:=True, Replace:=wdReplaceAll
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Background color change with drop down list Wolfin2010 Excel 1 02-02-2020 11:59 AM
how to change the selected area background color wordyg Word 0 01-28-2019 09:10 PM
Find and change the background color of certain keywords VBA change font color to background color donaldadams1951 Word VBA 6 05-31-2018 04:36 PM
Change excel background color, strange... sojiro Excel 7 04-18-2018 10:07 AM
Can't change table background color in the header in Microsoft Word 2011 simeon1 Word 0 10-13-2014 11:07 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft