Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Mickey
 
Posts: n/a
Default Replace shading with highlights

Is it possible to find and replace format/shading with the same color from
highlights? Do you have any tips for doing this through a large document
that has 2 colors in format/shading that need to be replaced with highlights?
Thank you.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman
 
Posts: n/a
Default Replace shading with highlights

Mickey wrote:
Is it possible to find and replace format/shading with the same color
from highlights? Do you have any tips for doing this through a large
document that has 2 colors in format/shading that need to be replaced
with highlights? Thank you.


Hi Mickey,

It's possible, using a macro, if a couple of assumptions are true:

- The exact color of the shading is known. For example, that it's yellow and
not some custom color that looks yellow.

- The shaded text consists of whole words (or, preferably, larger pieces
such as whole paragraphs). It's possible to look for shading applied to
individual characters or parts of words, but in a large document you'd grow
old waiting for it to finish. Checking words is a reasonable compromise,
maybe.

If that fits the bill, you can use a macro like this (see
http://www.gmayor.com/installing_macro.htm if needed). Change the color
designations in the macro as necessary to match the document colors.

Sub ShadeToHilite()
' change red shading to red highlighting
' change yellow shading to yellow highlighting
' ignore all other colors

Dim oWd As Range
For Each oWd In ActiveDocument.Words
With oWd
If .Shading.BackgroundPatternColorIndex _
= wdRed Then
.Shading.BackgroundPatternColorIndex _
= wdAuto
.HighlightColorIndex = wdRed
ElseIf .Shading.BackgroundPatternColorIndex _
= wdYellow Then
.Shading.BackgroundPatternColorIndex _
= wdAuto
.HighlightColorIndex = wdYellow
End If
End With
Next
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Word 2000 Find & Replace Drew Microsoft Word Help 6 November 16th 05 10:29 PM
Find & Replace (replace w/ field)? Not Really Me Microsoft Word Help 4 October 26th 05 04:22 PM
BUG with replace command gds Microsoft Word Help 0 October 20th 05 07:39 PM
Can't get Replace to work BruceM Microsoft Word Help 5 February 22nd 05 01:49 AM
Find and Replace anomaly BruceM Microsoft Word Help 7 January 18th 05 05:47 PM


All times are GMT +1. The time now is 08:11 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"