View Single Post
  #5  
Old July 5th, 2006, 06:25 PM posted to microsoft.public.word.tables
external usenet poster
 
Posts: n/a
Default how do i select and format all tables in a document at once

Also, if you have a long document with lots of tables, it may take quite a
while, up to minutes, for the tables to adjust to the new setting (which is
done in a background task).
You may be able to force that adjustment with a "ActiveDocument.Repaginate"
in your macro.

I sometimes first use AutoFit to Content, then to Window, and finally to
Fixed (so Word doesn't continually spend ressources in the background).
For that to work, I had to stick in an "ActiveDocument.Repaginate" after
each changing of the AutoFitBehaviour.

Regards,
Klaus



"Doug Robbins - Word MVP" schrieb im Newsbeitrag
...
More likely that

AutoFitBehavior wdAutoFitContent

is not what you are trying to do.

Try recording a macro of your taking the action one time and modify the
code that I gave you so that it incorporates the relevant part of the code
that is generated by the macro recorder.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"j smith" wrote in message
...
i can't make it work using this macro. i pasted it into a vb editor
window
so it reads like the following:


Sub spss()
Dim atable As Table
For Each atable In ActiveDocument.Tables
atable.AutoFitBehavior wdAutoFitContent
Next atable
End Sub

then i ran it from within word (version 2003).
nothing happened. am i doing it correectly?

many thanks

"Doug Robbins - Word MVP" wrote:

Try running the following macro:

Dim atable As Table
For Each atable In ActiveDocument.Tables
atable.AutoFitBehavior wdAutoFitContent
Next atable


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"j smith" j wrote in message
...
i have a huge document (several hundred pages) with hundreds of tables
exported from a statistical analysis program (SPSS). specifically, i
want
to
make each table "autofit to contents", because this will reduce the
size
of
my output by a large amount. i can't seem to find a way to select all
tables
at once; thus i cannot autofit all tables to contents at once.

thanks