vba code example - how to cycle through and format all tables (database tables) in a word doc

S

sheree

Does anyone know the syntax to cycle through all database tables in a word
doc in order to format them? For example, after they are "refreshed" with
the latest data, all formatting seems to be lost. I'd like to be able to
center all of them, and set font to Arial, 12pt. Any syntax examples of
something like this would be extremely helpful!
Thanks!
 
D

Doug Robbins

Hi Sheree,

Something like:

Dim atable As Table
For Each atable In ActiveDocument.Tables
With atable.Range
.Font.Name = "Arial"
.Font.Size = 12
.Paragraphs.Alignment = wdAlignParagraphCenter
End With
Next atable


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
Top