Select Table cell

M

Margaret Upton

Please could someone give me the code for selecting all the text in a table
cell from either the bottom or top of the cell. I would be grateful for
some help please.

Margaret
 
J

Jay Freedman

Margaret said:
Please could someone give me the code for selecting all the text in a
table cell from either the bottom or top of the cell. I would be
grateful for some help please.

Margaret

This bit first checks that the selection really is in a table, to prevent an
error. First it selects the entire cell. If that's enough, then comment out
the MoveEnd, which excludes the cell marker from the selection. I'm not sure
what the "from either the bottom or top of the cell" part is about -- it
doesn't matter where in the cell the selection is when the code runs.

If Selection.Information(wdWithInTable) Then
Selection.Cells(1).Select

' if you want only the text...
Selection.MoveEnd wdCharacter, -1
End If
 

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