Select a table in Word
I'm trying to develop a script to select an entire table in Word, but only if the insertion point (cursor) is within the table. If the insertion point is NOT within a table, I want the script to signal an error.
I have a working prototype, but it's not quite right. The code selects just one column, not the entire table.
Sub SelectThisTable()
On Error GoTo ErrorHandler
Selection.SelectColumn
' Do something with the selected table
Exit Sub
ErrorHandler:
MsgBox "Not in a table"
End Sub
|