View Single Post
 
Old 05-04-2014, 08:45 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,369
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Fitting the text in the same space when increasing the point size from 8 to 13 isn't possible. However, if you're prepared to change the cell sizes, it's quite possible to avoid the text wrapping. The following macro will re-format all the tables in your document:
Code:
Sub FormatTables()
' Turn Off Screen Updating
Application.ScreenUpdating = False
Dim SBar As Boolean, i As Long, j As Long, TblCell As Cell
' Store current Status Bar status, then switch on
SBar = Application.DisplayStatusBar
Application.DisplayStatusBar = True
With ActiveDocument
  j = .Tables.Count
  'Process all tables
  For i = 1 To .Tables.Count
    StatusBar = "Processing table: " & i & " of " & j
    With .Tables(i)
      'Set Autofit
      .AllowAutoFit = False
      'Turn off text wrapping in cells
      For Each TblCell In .Range.Cells
        TblCell.WordWrap = False
      Next
      'Reduce the cell left/right padding
      .LeftPadding = 2.5
      .RightPadding = 2.5
      'Set the font point size
      .Range.Font.Size = 13
      'Clear preferred dimensions
      .PreferredWidthType = wdPreferredWidthAuto
      .Columns.PreferredWidthType = wdPreferredWidthAuto
      'Set Autofit
      .AllowAutoFit = True
    End With
    DoEvents
  Next
End With
' Clear the Status Bar
Application.StatusBar = ""
' Restore original Status Bar status
Application.DisplayStatusBar = SBar
' Turn On Screen Updating
Application.ScreenUpdating = True
End Sub
Note: There's a lot of work to be done, so don't expect blazing performance. A progress report is displayed on the status bar.

For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote