View Single Post
  #3   Report Post  
Posted to microsoft.public.word.tables
Shauna Kelly Shauna Kelly is offline
external usenet poster
 
Posts: 571
Default How do I determine if an entire cell is selected vs...

Hi David

If you turn on non-printing characters (see
http://www.word.mvps.org/FAQs/Format...rintChars.htm), you'll see that
every cell is marked with an end-of-cell marker. If the user has the whole
cell selected, then the selection will include that end-of-cell marker. But
if the user has only selected some text (perhaps even all the text, but not
the cell itself), then the selection will not include the end-of-cell
marker.

The end-of-cell marker is actually 2 characters: chr(13) & chr(7), and you
can test for those in your code.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"David Cardinale" David wrote in
message ...
Hello,

I am trying to figure out how I can programatically determine if an entire
cell has been selected (by the user clicking on the border around the
cell)
as opposed to simply having the cursor in the cell. I've tried everything
I
can think of with Word.Selection but can't find any differences.

My problem is that I am inserting bookmarks into the cell, but whenever
the
entire cell is selected, Word's formatting character for the cell ends up
within the bookmark and I need to prevent this.

Thank you.

David