Select method doesn't work properly 
Author Message
 Select method doesn't work properly

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



Sun, 18 Apr 2004 23:01:06 GMT  
 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



Mon, 19 Apr 2004 05:34:09 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Documenter doesn't work properly in A2K

2. Small toolbar look - toolbar control doesn't work properly

3. AllocUnit() function doesn't work properly with NTFS

4. VBScript Eval function doesn't work properly

5. STMAdmin.dll to query NT Log doesn't seem to work properly

6. My CommonDialog doesn't work properly

7. CreateProcess function doesn't work properly.

8. Match in DataCombo doesn't work properly

9. Replace function doesn't work properly

10. CreateProcess function doesn't work properly.

11. mmioInstallIOProc() doesn't work properly when compiled to native code

12. TVM_INSERTITEM doesn't seem to work properly

 

 
Powered by phpBB® Forum Software