The function below accept the index number and return the table title.
The table title will often be empty.
strTableTitle = GetTableTitle(3)
Function GetTableTitle( _
ByVal i As Integer) As String
'Tested 20090208
On Error GoTo errHandler1:
If i > ActiveDocument.all. _
tags("table").Length - 1 Then _
GoTo errHandler2:
GetTableTitle = _
ActiveDocument.all. _
tags("table").Item(i).Title
Exit Function
errHandler1:
'Notify user of failure.
MsgBox "GetTableTitles has failed", _
vbCritical, "Function Failure"
errHandler2:
'Notify user of failure.
MsgBox "Table " & i & " does not exist.", _
vbCritical, "Table Not Found"
End Function