Shadings

A

Antek

Hi,

I have a big Word97 file containing text and a lot of tables.
Some rows of the tables had been greyed using:
Format > Borders and Shading > Shading tab > 25%.

My question is: how to get rid of the grey shadings
for all rows in the file?

I would be very grateful for any help or advice.

Regards,
Antek
 
L

Lene Fredborg

You may use the macro below. The macro will remove the shading from all
tables in the active document (I have Word 2003 installed and cannot test the
macro with Word 97).

Sub RemoveTableShading()
Dim oTable As Table
For Each oTable In ActiveDocument.Tables
With oTable.Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
Next oTable
End Sub

For help on installing macros, see:
http://www.gmayor.com/installing_macro.htm

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
A

Antek

Thank you very much.

I don't know if it is because of differences between Word2003 and Word97.
I don't know a lot of macros :-(.

I get information pointing to
.ForegroundPatternColor =
and saying that there is an error of compilation
and that it cannot find a method or data component
(this is my translation, I use Polish version of Office97).

Regards,
Antek
 
S

Suzanne S. Barnhill

If you're not trying to do this programmatically (with a macro) but just
want to do it manually, just select the entire table and go to Format |
Borders and Shading. On the Shading tab, select No Fill.
 
L

Lene Fredborg

I think that the problem is caused by different Word versions. There is a
chance that the macro will work if you make the following replacements in the
code:

Replace "ForegroundPatternColor" by "ForegroundPatternColorIndex"
and
Replace "BackgroundPatternColor" by "BackgroundPatternColorIndex"

Again, I cannot test the macro in Word 97 - hope it works.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
A

Antek

It works!
The problem has been solved!
Once again, thank you very, very much.

Regards,
Antek
 
A

Antek

Thanks for your answer.
I know the method you've mentioned but I have too many
tables in the file to do it manually.
However Lene Fredborg sent me a macro which solved
the problem.

Regards,
Antek
 

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