Solved

find and replace shading

Posted on 2008-10-06
8
796 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
ID: 22653642
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
ID: 22653678
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
ID: 22653761
I have tried this already but no success
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Author Comment

by:Shawn
ID: 22653803
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
ID: 22680355
Deleted post.
0
 
LVL 1

Author Comment

by:Shawn
ID: 22680389
??
0
 
LVL 1

Accepted Solution

by:
Shawn earned 0 total points
ID: 22715395
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding to a VBA? 6 60
Crystal reports - Formula Field code need assistance with code 17 51
MS Date Picker 64 bit 32 bit issue 12 49
copy the content of word to outlook 3 46
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

929 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

13 Experts available now in Live!

Get 1:1 Help Now