#1
|
|||
|
|||
Resize and center tables
I have a macro that resizes all tables in a document to margin width, but it doesn't center them, which is also part of our style. I have tried to find the right code in VBA, starting a line with oTbl. and seeing what optins come up, but it's pure trial and error -- and all errors. There doesn't seem to be a horizontal alignment tag... Here's what I have:
Code:
Sub ResizeAllTables() Dim oTbl As Table For Each oTbl In ActiveDocument.Tables oTbl.AutoFitBehavior wdAutoFitFixed With ActiveDocument.PageSetup oTbl.PreferredWidth = .PageWidth - .LeftMargin - .RightMargin End With Next oTbl End Sub |
#2
|
||||
|
||||
hi Ulodesk,
Try: oTbl.Rows.Alignment = wdAlignRowCenter Hint: If you aren't sure how to do something, using the macro recorder to record the process will often show you how.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word VBA: Resize Table Width??? | tinfanide | Word VBA | 5 | 04-21-2012 03:00 PM |
How to resize the number of the heading after being disappeared??? | Jamal NUMAN | Word | 1 | 04-15-2011 06:21 PM |
Resize video across multiple slides | joelas | PowerPoint | 3 | 09-28-2010 07:59 PM |
Resize-to-fit Table Columns (PowerPoint) | icu222much | PowerPoint | 0 | 06-06-2010 11:21 AM |
equation automatic resize | Landsman | Word | 0 | 02-24-2009 09:55 AM |