This is any page, not just the first or end page. If range is not possible is
it possible with a paragraph?
Jezebel - 29 Jun 2005 01:04 GMT
You can use
MyRange.Information(wdVerticalPositionRelativeToPage)
to retrieve the vertical position of the start of range. If you know the
vertical position of a range at start of page (ie, if the layout is fixed
you can work this out in advance) then simply compare with that. Or get the
vertical position of the preceding character and compare ... if it's less,
the preceding character is on the same page, and your range is therefore not
at the start --
if activedocument.Range(MyRange.Start - 1, MyRange.Start -
1).Information(wdVerticalPositionRelativeToPage) <
MyRange.Information(wdVerticalPositionRelativeToPage) then
... not at start of page
Bear in mind, this will throw an error if MyRange is at the start of
document.
> This is any page, not just the first or end page. If range is not possible
> is
> it possible with a paragraph?
Jean-Guy Marcil - 29 Jun 2005 02:50 GMT
Jeremy was telling us:
Jeremy nous racontait que :
> This is any page, not just the first or end page. If range is not
> possible is it possible with a paragraph?
You could compare the currently selected selection range.start value with
the current page range.start value:
'_______________________________________
Dim curPageRge As Range
Dim curSelRge As Range
Set curSelRge = Selection.Range
curSelRge.Collapse wdCollapseStart
Set curPageRge = curSelRge.Bookmarks("\page").Range
If curSelRge.Start = curPageRge.Start Then
MsgBox "Selection is at top of page."
Else
MsgBox "Selection is NOT at top of page."
End If
'_______________________________________

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org