How about
:
Code:
Sub subNumberTableColumns()
Dim oTbl As Table
Dim lngIndex As Integer
Dim oRng As Range
On Error GoTo Error_subNumberTableColumns
If Selection.Information(wdWithInTable) Then
Set oTbl = Selection.Tables(1)
For lngIndex = 1 To oTbl.Rows.Count - 1
Set oRng = oTbl.Cell(lngIndex + 1, 1).Range
oRng.InsertBefore lngIndex & ". "
Next lngIndex
Else
MsgBox "You must be in a table to number the table.", vbCritical, "Number Block"
End If
lbl_Exit:
Exit Sub
Error_subNumberTableColumns:
MsgBox "An unexpected situation arose in your program." & vbCrLf & _
"Please write down the following details:" & vbCrLf & vbCrLf & _
"Module Name: " & "(MODULE_NAME)" & vbCrLf & _
"Type: VBA Document: " & vbCrLf & _
"Calling Procedure: " & "(PROCEDURE_NAME}" & vbCrLf & _
"Error Number: " & Err.Number & vbCrLf & _
"Error Descritption: " & Err.Description & vbCrLf & vbCrLf & _
"Resume Exit_" & "(PROCEDURE_NAME)"
Resume lbl_Exit
End Sub