
Select method doesn't work properly
The following macro will select only the last "paragraph" if the current
selection is in the last cell of the table:
Sub GetLastParainTable()
Dim iCellCount As Integer
Dim oRng As Range
iCellCount = Selection.Tables(1).Range.Cells.Count
If
Selection.Range.InRange(Selection.Tables(1).Range.Cells(iCellCount).Range)
Then
Set oRng = ActiveDocument.Range _
(Start:=Selection.Tables(1).Range.Cells(iCellCount).Range.Paragraphs.Last.Ra
nge.Start, _
End:=Selection.Tables(1).Range.Cells(iCellCount).Range.Paragraphs.Last.Range
.End - 1)
oRng.Select
End If
End Sub
HTH
Quote:
> With the following line, if the cursor is in the last paragraph in a table
> cell, it is not the last paragraph that gets selected, but all text in the
> cell. Why, and how do I get around it?
> Selection.Paragraphs(1).Range.Select
> /Grober