View Single Post
 
Old 09-18-2019, 06:16 AM
gmaxey gmaxey is online now Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Something like this might get you close:


Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oTbl As Table
Dim oRng As Range
Dim strList As String
Dim oRow As Row
Dim lngRow As Long
  For Each oTbl In ActiveDocument.Tables
    If oTbl.Style = "Table Grid" Then
      Set oRng = oTbl.Range
      oRng.Collapse wdCollapseStart
      oRng.Move wdParagraph, -1
      If Not oRng.Paragraphs(1).OutlineLevel < 10 Then
        Do
          oRng.Move wdParagraph, -1
        Loop Until oRng.Paragraphs(1).OutlineLevel < 10
      End If
    End If
    strList = oRng.Paragraphs(1).Range.ListFormat.ListString
    lngRow = 0
    For Each oRow In oTbl.Rows
      lngRow = lngRow + 1
      oRow.Cells(1).Range.Text = strList & "." & lngRow
    Next oRow
  Next oTbl
lbl_Exit:
  Exit Sub
  
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote