Get row & column numbers of selected table cell

A

AL

When a cell in Word table is selected, how do I obtain the row number &
column number of selected cell? I am able to detect, using
WindowSelectionChange, when the focus changes within a Word document, but
want to know where the focus is, specifically the row and column numbers of
the cell receiving the focus and/or selection.
 
T

Tony Jollans

Within a WindowSelectionChange procedure, something like this:

If Sel.Information(wdWithInTable) Then
MsgBox "Row " & Sel.Cells(1).RowIndex & _
" Column " & Sel.Cells(1).ColumnIndex
End If
 
A

AL

Tony:
That works great. Thank you.

AL

Tony Jollans said:
Within a WindowSelectionChange procedure, something like this:

If Sel.Information(wdWithInTable) Then
MsgBox "Row " & Sel.Cells(1).RowIndex & _
" Column " & Sel.Cells(1).ColumnIndex
End If

--
Enjoy,
Tony

www.WordArticles.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top