View Single Post
  #2  
Old October 23rd, 2007, 09:48 PM posted to microsoft.public.word.tables
Lene Fredborg
external usenet poster
 
Posts: 1,294
Default how do you change the margin of all tables in a document at once?

You could try this:
Make a backup copy of your document (just in caseā€¦).
Install and run the macro below:

Sub AdjustTableWidth()
Dim oTable As Table

For Each oTable In ActiveDocument.Tables
With oTable
.PreferredWidthType = wdPreferredWidthPercent
.PreferredWidth = 100
End With
Next oTable

End Sub

The macro iterates through all tables in the document and sets the preferred
table width to 100% (I assume that the tables are currently aligned to the
left margin). This should make the tables fit between the left and right
margins - corresponds to setting Table Table Properties Table tab
Pre-ferred width to 100%. However, since I don't know how your tables are set
up, I cannot guarantee that the result is exactly as you wish (but then you
have your baskup...).

For help on installing macros, see:
http://www.gmayor.com/installing_macro.htm

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"+Brian" wrote:

I have a several hundred page document which is formated for landscape and
contains several hundred individual tables. When I convert the document to
portrait the right margin of all the tables is not off the page and out of
sight and the text is truncated.

How do I get the right margin of all the tables to conform to the portrait
margins without individually selecting each table, one at a time, and moving
its margin?