J
jwirt
I am trying to Collapse, Move, Expand, etc. the selection within a cel
of a table.
Almost no matter what I try, the code I've written collapses th
current selection to a point at the beginning of text in the cell an
then expands it unit by unit to the whole table (in debug mode when
press F8). This is not what I want. I want to collapse the
selection to an insertion point at the end of the text in the cell
then insert some text, and then select that text.
At the beginning of this sequence, the code has just inserted a new ro
in the table, inserted some text in the row, and formatted it
Visually, the selection at the end of these steps appears to be th
entire row (the row has only one cell) in that the selection are
includes the entire cell and laps over the right margin a little. I
looks like a selection of the cell (or in this case the new row) of th
table.
The code that inserts the row has a range, rngTable5, which equals th
entire table where the row has been inserted active. In addition, th
newly inserted row, which consists of a single cell, is selected.
I've tried the following statements to collapse the current selectio
(the row) to the end of the text in the first cell (i.e., in th
selected one celled row):
Selection.Shrink
Selection.Collapse Direction:=wdCollapseEnd
Selection.Collapse Direction:=wdCollapseStart
Selection.Move Unit:=wdCell, Count:=1
Selection.Move Unit:=wdCell, Count:=0
Selection.Move Unit:=wdSentence, Count:=Count=1
Selection.MoveEnd Unit:=wdCell, Count:=-1
And so on. No matter which of these statements I try, when I execut
it stepwise by pressing F8 multiple times, the selection collapses t
an insertion point at the beginning of the current cell, expands to th
first word, expands to the second word, expands to the 3rd word, etc.
then expands to the entire cell, the entire row, the enite table, an
finally the entire document.
Anyway, what statement can I use to move a selection within a tabl
cell to the end of the text in the cell and insert some text at tha
point and reexpand the selection to include that text. To start th
cell is selected, not just the text inside the cell.
Thank you.
John Wir
of a table.
Almost no matter what I try, the code I've written collapses th
current selection to a point at the beginning of text in the cell an
then expands it unit by unit to the whole table (in debug mode when
press F8). This is not what I want. I want to collapse the
selection to an insertion point at the end of the text in the cell
then insert some text, and then select that text.
At the beginning of this sequence, the code has just inserted a new ro
in the table, inserted some text in the row, and formatted it
Visually, the selection at the end of these steps appears to be th
entire row (the row has only one cell) in that the selection are
includes the entire cell and laps over the right margin a little. I
looks like a selection of the cell (or in this case the new row) of th
table.
The code that inserts the row has a range, rngTable5, which equals th
entire table where the row has been inserted active. In addition, th
newly inserted row, which consists of a single cell, is selected.
I've tried the following statements to collapse the current selectio
(the row) to the end of the text in the first cell (i.e., in th
selected one celled row):
Selection.Shrink
Selection.Collapse Direction:=wdCollapseEnd
Selection.Collapse Direction:=wdCollapseStart
Selection.Move Unit:=wdCell, Count:=1
Selection.Move Unit:=wdCell, Count:=0
Selection.Move Unit:=wdSentence, Count:=Count=1
Selection.MoveEnd Unit:=wdCell, Count:=-1
And so on. No matter which of these statements I try, when I execut
it stepwise by pressing F8 multiple times, the selection collapses t
an insertion point at the beginning of the current cell, expands to th
first word, expands to the second word, expands to the 3rd word, etc.
then expands to the entire cell, the entire row, the enite table, an
finally the entire document.
Anyway, what statement can I use to move a selection within a tabl
cell to the end of the text in the cell and insert some text at tha
point and reexpand the selection to include that text. To start th
cell is selected, not just the text inside the cell.
Thank you.
John Wir