Discussion:
How to change style of all tables in a document at once?
(too old to reply)
Doctor Document
2010-02-27 17:38:01 UTC
Permalink
I'm copying tables from many documents and sources outside word and pasting
them into a single word document. When I want to apply a uniform formatting
throughout my new document I find myself manually selecting each table using
the 'Goto' button and applying the table styles to each table.

There are over 300 tables in this document. What's the easier way out? I
have to make twelve other documents similar to this one. Is there a way to
define a pasting formatting for tables? Anyone please help.
Stefan Blom
2010-02-27 18:36:22 UTC
Permalink
You could use a macro such as the following:

Sub ApplyTableStyle()
Dim t As Table
For Each t In ActiveDocument.Tables
t.Style = "Light Shading - Accent 3" 'Specify table style name here
Next t
End Sub
--
Stefan Blom
Microsoft Word MVP
Post by Doctor Document
I'm copying tables from many documents and sources outside word and pasting
them into a single word document. When I want to apply a uniform formatting
throughout my new document I find myself manually selecting each table using
the 'Goto' button and applying the table styles to each table.
There are over 300 tables in this document. What's the easier way out? I
have to make twelve other documents similar to this one. Is there a way to
define a pasting formatting for tables? Anyone please help.
L. Gautero
2010-03-07 01:43:01 UTC
Permalink
Dear Stefan,

Thanks for the suggestion, unfortunately in my case, it is not performing
well, in fact the table keep other styles, especially when the contents of
the table (objects as MS Equation) have a style on their own.

basically the whole table is presented having the style of its content.
Is there a way to make this more ordered?
(i.e. a table has its style, independetly from the style of the content of
the cells)

regards
Post by Stefan Blom
Sub ApplyTableStyle()
Dim t As Table
For Each t In ActiveDocument.Tables
t.Style = "Light Shading - Accent 3" 'Specify table style name here
Next t
End Sub
--
Stefan Blom
Microsoft Word MVP
Post by Doctor Document
I'm copying tables from many documents and sources outside word and pasting
them into a single word document. When I want to apply a uniform formatting
throughout my new document I find myself manually selecting each table using
the 'Goto' button and applying the table styles to each table.
There are over 300 tables in this document. What's the easier way out? I
have to make twelve other documents similar to this one. Is there a way to
define a pasting formatting for tables? Anyone please help.
.
Stefan Blom
2010-03-07 13:13:59 UTC
Permalink
Well, you could use a macro to format the contents of cells as well.

Of course, since there are many factors to consider, this might be tricky or
at least time-consuming. In particular, I don't know how to modify equations
using VBA (if it's even possible).
--
Stefan Blom
Microsoft Word MVP
Post by L. Gautero
Dear Stefan,
Thanks for the suggestion, unfortunately in my case, it is not performing
well, in fact the table keep other styles, especially when the contents of
the table (objects as MS Equation) have a style on their own.
basically the whole table is presented having the style of its content.
Is there a way to make this more ordered?
(i.e. a table has its style, independetly from the style of the content of
the cells)
regards
Post by Stefan Blom
Sub ApplyTableStyle()
Dim t As Table
For Each t In ActiveDocument.Tables
t.Style = "Light Shading - Accent 3" 'Specify table style name here
Next t
End Sub
--
Stefan Blom
Microsoft Word MVP
Post by Doctor Document
I'm copying tables from many documents and sources outside word and pasting
them into a single word document. When I want to apply a uniform formatting
throughout my new document I find myself manually selecting each table using
the 'Goto' button and applying the table styles to each table.
There are over 300 tables in this document. What's the easier way out? I
have to make twelve other documents similar to this one. Is there a way to
define a pasting formatting for tables? Anyone please help.
.
Loading...