Clearing background color on text in word 2007

K

Ken

I have a large document in which I have filled the character cells with a
colour to highlight for me, while editing, that it needs additional treatment.

Problem is, I have to generate a print a copy of the document for my advisor
to read. Is there anyway I can run a macro to clear the highlights in the
whole document easily?
 
G

Graham Mayor

It would help to know how you applied the formatting and to what, but from
your description it seems you may be discussing a table with background
colouring in some cells. The following will remove all the background
colouring in table cells in a document, and print the document to the
currently active printer before restoring the document with the cell
colouring intact.

Dim sTable As Table
Dim myDoc As Document
Dim docName As String
Set myDoc = ActiveDocument
myDoc.Save
docName = myDoc.FullName
For i = 1 To myDoc.Tables.Count
Set sTable = myDoc.Tables(i)
sTable.Select
With Selection.Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
Next i
myDoc.PrintOut
myDoc.Close wdDoNotSaveChanges
Documents.Open docName


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top