A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how do you change the margin of all tables in a document at once?



 
 
Thread Tools Display Modes
  #1  
Old October 23rd, 2007, 02:56 PM posted to microsoft.public.word.tables
+Brian
external usenet poster
 
Posts: 1
Default how do you change the margin of all tables in a document at once?

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?
Ads
  #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?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright ©2004-2018 OfficeFrustration.
The comments are property of their posters.