• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1143
  • Last Modified:

find and replace shading

Hi all,
I have a document where parts of the text are highlighted or shaded in light yellow. It seems I can't use standard search and replace to replace the highlighted text.

Can anyone help me to find a way to find the shaded parts in the document?
  • 5
1 Solution
ShawnAuthor Commented:
this is what I need to find
.BackgroundPatternColor = wdColorYellow
and need to replace any highlighted text with "" (nothing).

The end goal is to count the words that are not highlighted.
ParanormasticCryptographic EngineerCommented:
You can do that with the search and replace feature, but you need to use the advanced options.

- Ctrl + H
- 'More' button
- 'Format' button
- Highlight (Highlight appears under box for Find what)
- Repeat last 2 steps for Replace With box
- Use the Highligher icon in the main Word window (the pencil with ab, next to character color) and select the desired new color - select 'none' to erase.
- Replace all, or Find Next and Replace as desired if you want to keep some. * note this will change all highlighted items if you replace all, not just any particular color.  (for font/text color, you can actually look for the specific color and be more granular, for backgrounds/highlight you cannot).

ShawnAuthor Commented:
I have tried this already but no success
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

ShawnAuthor Commented:
it is not actually the "highlight" function I am looking for it is the  .BackgroundPatternColor = wdColorLightYellow.

the results can be similar looking but I'm pretty sure BackgroundPatternColor  needs to be searched via  a macro using VB
Joanne M. OrzechManager, Document Services CenterCommented:
Deleted post.
ShawnAuthor Commented:
ShawnAuthor Commented:
got it...thanks anyway.

here's the end result...works great

Sub FindHighlightedText()

Selection.HomeKey Unit:=wdStory

With Selection.Find
.Font.Shading.BackgroundPatternColor = wdColorLightYellow
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll

End With

End Sub

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now