Thread: [Solved] Delete Empty Table Rows
View Single Post
 
Old 02-27-2017, 01:30 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,138
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

My fault, I sent you an unsaved earlier version

The sub should be

Code:
Sub ProcessRanges()
Dim oStory As Range
   For Each oStory In ActiveDocument.StoryRanges
        DeleteEmptyRows oStory
        If oStory.StoryType <> wdMainTextStory Then
            While Not (oStory.NextStoryRange Is Nothing)
                Set oStory = oStory.NextStoryRange
                DeleteEmptyRows oStory
            Wend
        End If
    Next oStory
    Set oStory = Nothing
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