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
 

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