View Single Post
 
Old 01-19-2015, 04:50 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,106
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 of
Default

You don't really need a macro for this. Apply the List Number style to the headings. If your document is typical the following will do it.

Code:
Sub AddNumStyle()
Dim oPara As Range
Dim oTable As Table
    For Each oTable In ActiveDocument.Tables
        Set oPara = oTable.Range
        oPara.Collapse 1
        oPara.Start = oPara.Start - 2
        oPara.Collapse 1
        oPara.End = oPara.Paragraphs(1).Range.End
        oPara.Style = "List Number"
    Next oTable
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