Need a global macro to change table style

J

Jackie Damrau

Hello,

I'm new to this group and have found so much information so far, but now I need your help.

I need a macro that will replace the TableNormal style with TableElegant throughout an entire document. What appeared as simple macro coding has now exacerbated my scant skills.

If you can help, please respond to me personally.
--
Jackie Damrau
Dynamic Online Training (DOT)
Perot Systems Corporation
Ph. 972.577.6243
Cell: 214.505.0100
email: (e-mail address removed)
 
K

Klaus Linke

I need a macro that will replace the TableNormal style
with TableElegant throughout an entire document.


Hi Jackie,

Not 100% sure since I haven't needed it myself:

Dim myTable As Table
For Each myTable In ActiveDocument.Tables
If myTable.style = _
ActiveDocument.Styles(wdStyleNormalTable) Then
myTable.AutoFormat Format:=wdTableFormatElegant
End If
Next myTable

One problem could be that .Style might return a paragraph, character or
list style in some cases...
Post back if it doesn't work!

Regards,
Klaus
 

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