Alright, now... i only ask questions when i really need help... so here goes.
I have documents that have all this highlighting to help notify people of
issues that may or may not be problematic, so i have this-
Sub RemoveHighlights()
Dim rngSearch As Word.Range
Application.ScreenUpdating = False
Set rngSearch = ActiveDocument.Range
rngSearch.Find.ClearFormatting
rngSearch.Find.Replacement.ClearFormatting
With rngSearch.Find
.Format = True
.highLight = True
.Replacement.highLight = False
.Execute Replace:=wdReplaceAll
End With
Application.ScreenUpdating = True
End Sub
Well, i get a document, and it turns out a programmer has added shading, not
highlighting.
I've tried all kinds of things to delete shading using a range, and i can't
figure it out. I searched through past threads and didn't find anything also.
If anyone could help it'd be much appreciated.
Thanks guys.
Dave Lett - 09 Feb 2006 16:41 GMT
Hi,
I think you can use something like the following:
With ActiveDocument.Range
.HighlightColorIndex = wdNoHighlight
.Shading.BackgroundPatternColorIndex = wdNoHighlight
End With
HTH,
Dave
> Alright, now... i only ask questions when i really need help... so here goes.
>
[quoted text clipped - 32 lines]
>
> Thanks guys.
Chuck Henrich - 09 Feb 2006 16:49 GMT
If you want to remove *all* shading and highlighting, you could use the
following instead of find/replace:
With ActiveDocument.Range
With .Font.Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
.HighlightColorIndex = wdNoHighlight
End With
Alternatively you could loop through all the paragraphs (or even words) in
your document looking for a particular shading background color or background
color index and replacing it with 0 (for wdColorAutomatic), eg:
Dim p As Paragraph
For Each p In ActiveDocument.Paragraphs
'XX = index number or constant for the shading
'you want to remove
If p.Range.Font.Shading.BackgroundPatternColorIndex = XX Then
p.Range.Font.Shading.BackgroundPatternColorIndex = 0
End If
Next p
You can also set your criteria to background color, foreground color/color
index, texture, etc.
HTH

Signature
Chuck Henrich
www.ProductivityApps.com
Stylist Style Generator - automatically create and define sets of paragraph
numbering and heading styles
> Alright, now... i only ask questions when i really need help... so here goes.
>
[quoted text clipped - 32 lines]
>
> Thanks guys.