Ed was telling us:
Ed nous racontait que :
> Is it possible in Word 2000 to find if two ranges intersect, and if so
> where? For instance, I have a section of my document as a range, and
> I want to find out if an inserted text block with its own range
> definition is contained within that section's range. Is it possible?
Try this:
Dim secRge As Range
Dim textRge As Range
Set secRge = ActiveDocument.Sections(2).Range
Set textRge = Selection.Range
If textRge.InRange(secRge) Then
MsgBox "The selected range is contained in the target section."
ElseIf (textRge.Start > secRge.Start And textRge.Start < secRge.End) Or _
(textRge.End < secRge.End And textRge.End > secRge.Start) Then
MsgBox "The two ranges intersect."
Else
MsgBox "The two ranges are distinct."
End If

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