View Single Post
 
Old 01-05-2016, 03:54 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

The error suggests your document has one or more tables where the cell widths in a given column differ. That's only something I expected to occur if you had already merged some tables. That said, the following modifications should address the issue:
Code:
Sub FixTables()
Application.ScreenUpdating = False
Dim Tbl As Table, i As Long
With ActiveDocument
  For Each Tbl In .Tables
    With Tbl
      With .Rows
        .LeftIndent = 0
        .WrapAroundText = False
        .Alignment = wdAlignRowCenter
      End With
      .TopPadding = 0
      .LeftPadding = 0
      .RightPadding = 0
      .BottomPadding = 0
      .AllowAutoFit = False
      .PreferredWidthType = wdPreferredWidthAuto
      If .Uniform Then
        .Columns(1).Width = CentimetersToPoints(1#)
        .Columns(2).Width = CentimetersToPoints(3.75)
        .Columns(3).Width = CentimetersToPoints(3.75)
        .Columns(4).Width = CentimetersToPoints(3.75)
        .Columns(5).Width = CentimetersToPoints(3.75)
      Else
        For i = 1 To .Range.Cells.Count
          Select Case (i - 1 Mod 5) + 1
            Case 1: .Range.Cells(i).Width = CentimetersToPoints(1#)
            Case Else: .Range.Cells(i).Width = CentimetersToPoints(3.75)
          End Select
        Next
      End If
  End With
  While .Tables.Count > 1
    .Tables(1).Range.Characters.Last.Next.Delete
  Wend
Next
End With
Application.ScreenUpdating = True
End Sub
There is no such thing as a default cell width in Word.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote