Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1230
  • 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
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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