Solved

find and replace shading

Posted on 2008-10-06
8
785 Views
Last Modified: 2011-10-03
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?
0
Comment
Question by:Shawn
  • 5
8 Comments
 
LVL 1

Author Comment

by:Shawn
Comment Utility
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.
0
 
LVL 31

Expert Comment

by:Paranormastic
Comment Utility
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).

0
 
LVL 1

Author Comment

by:Shawn
Comment Utility
I have tried this already but no success
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 1

Author Comment

by:Shawn
Comment Utility
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
0
 
LVL 37

Expert Comment

by:Joanne M. Orzech
Comment Utility
Deleted post.
0
 
LVL 1

Author Comment

by:Shawn
Comment Utility
??
0
 
LVL 1

Accepted Solution

by:
Shawn earned 0 total points
Comment Utility
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
Selection.Find.Execute

End Sub
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now