J
John Wirt
I am trying to Collapse, Move, Expand, etc. the selection within a cell of a
table.
Almost no matter what I try, the code I've written collapses the current
selection to a point at the beginning of text in the cell and then expands
it unit by unit to the whole table. First the insertion point is expanded to
the first word in the text in the table cell, then to include the first and
second word, then the first three words, then the entire cell (row), and
then the entire table. 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 row in
the table, inserted some text in the row, and formatted it. Visually, the
selection at the end of these steps appears to be the entire row (the row
has only one cell) in that the selection area includes the entire cell and
laps over the right margin a little. It looks like a selection of the cell
(or in this case the new row) of the table.
The code that inserts the row hs a range, rngTable5, which equals the entire
table where the row has been inserted active. In addition, the newly
inserted row, which consists of a single cell, is selected.
I've tried the following statements to collapse the current selection (the
row) to the end of the text in the first cell (i.e., in the 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 soon. No matter which of these statements I try, when I execute it
stepwise by pressing F8 multiple times, the selection collapses to an
insertion point at the beginning of the current cell, expands to the first
word, expands to the second word, expands to the 3rd word, etc., then
expands to the entire cell, the entire row, and finally the entire table.
I've stopped pressing F* at this point, I presumet the next step would be to
select the whole documents.
Anyway, what statement can I use to move a selection within a table cell to
the end of the text in the cell and insert some text at that point and
reexpand the selection to include that text. To start the cell is selected,
not just the text inside the cell.
Thank you.
John Wirt
table.
Almost no matter what I try, the code I've written collapses the current
selection to a point at the beginning of text in the cell and then expands
it unit by unit to the whole table. First the insertion point is expanded to
the first word in the text in the table cell, then to include the first and
second word, then the first three words, then the entire cell (row), and
then the entire table. 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 row in
the table, inserted some text in the row, and formatted it. Visually, the
selection at the end of these steps appears to be the entire row (the row
has only one cell) in that the selection area includes the entire cell and
laps over the right margin a little. It looks like a selection of the cell
(or in this case the new row) of the table.
The code that inserts the row hs a range, rngTable5, which equals the entire
table where the row has been inserted active. In addition, the newly
inserted row, which consists of a single cell, is selected.
I've tried the following statements to collapse the current selection (the
row) to the end of the text in the first cell (i.e., in the 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 soon. No matter which of these statements I try, when I execute it
stepwise by pressing F8 multiple times, the selection collapses to an
insertion point at the beginning of the current cell, expands to the first
word, expands to the second word, expands to the 3rd word, etc., then
expands to the entire cell, the entire row, and finally the entire table.
I've stopped pressing F* at this point, I presumet the next step would be to
select the whole documents.
Anyway, what statement can I use to move a selection within a table cell to
the end of the text in the cell and insert some text at that point and
reexpand the selection to include that text. To start the cell is selected,
not just the text inside the cell.
Thank you.
John Wirt