View Single Post
 
Old 11-17-2017, 01:51 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You need to process all the story ranges separately e.g.

Code:
Option Explicit

Sub ConsistensifyTables()
Dim oStory As Range
Dim oTable As Table
    'Show No markup
    With ActiveWindow.View.RevisionsFilter
        .Markup = wdRevisionsMarkupNone
        .View = wdRevisionsViewFinal
    End With
    For Each oStory In ActiveDocument.StoryRanges
        For Each oTable In oStory.Tables
            With oTable
                With .Rows
                    .Alignment = wdAlignRowCenter
                    .LeftIndent = CentimetersToPoints(0)
                End With
                .AutoFitBehavior (wdAutoFitFixed)
                .PreferredWidthType = wdPreferredWidthPoints
                .PreferredWidth = CentimetersToPoints(17.03)
            End With
        Next oTable
        If oStory.StoryType <> wdMainTextStory Then
            While Not (oStory.NextStoryRange Is Nothing)
                Set oStory = oStory.NextStoryRange
                For Each oTable In oStory.Tables
                    With oTable
                        With .Rows
                            .Alignment = wdAlignRowCenter
                            .LeftIndent = CentimetersToPoints(0)
                        End With
                        .AutoFitBehavior (wdAutoFitFixed)
                        .PreferredWidthType = wdPreferredWidthPoints
                        .PreferredWidth = CentimetersToPoints(17.03)
                    End With
                Next oTable
            Wend
        End If
    Next oStory
lbl_Exit:
    Set oStory = Nothing
    Set oTable = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote