setup
following the last post on the function fGetUserInpIdx (see more in here), how would the user know the index number of a, say, table? looks like a marco's called for.
solution
the plan
- tell if the cursor's inside a table. if not, ask to place inside one to check upon and run macro again.
- count the number of tables from doc start to cursor.
- pop the number up in a window.
programming language & module(s)
- VBA
file preps
place the cursor inside the table whose index number we'd like to know.
variables to customize
none.
the script
vTblIdx
| Sub vTblIdx() | |
| If Selection.Information(wdWithInTable) Then | |
| MsgBox "table Idx: " & ActiveDocument.Range(0, Selection.Start).Tables.Count | |
| Else | |
| MsgBox "please place the cursor inside a table and run again." | |
| End If | |
| End Sub |
output

note to self
none.