first listparagraph on page

N

Noline Wilson

How do I get select the first listparagraph on the current page? I can
select the first one, but sometimes it's the last part of the one on
the previous page. What I need is the first listparagraph the starts
on the current page.

Thanks for all the help.

Clayton
 
H

Helmut Weber

Hi Noline,

without covering all possible variations,
like long listparagraphs that span over serveral pages
or pages on which is no listparagraph at all
or pages which do not contain
at least two listparagraphs...

Again, just in principle:

Sub Test76()
Dim P1 As Long
Dim P2 As Long
Dim rTmp As Range
With Selection
.Collapse
.ExtendMode = False
P1 = .Information(wdActiveEndPageNumber)
' insertionpoint is on page P1
With .Bookmarks("\page").Range
Set rTmp = .ListParagraphs(1).Range
rTmp.Collapse
' on which page does the 1st listparagrph start
P2 = rTmp.Information(wdActiveEndPageNumber)
If P1 = P2 Then
.ListParagraphs(1).Range.Select
ElseIf P1 > P2 Then
.ListParagraphs(2).Range.Select
End If
End With
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top