tags:

views:

425

answers:

2

How can you detect if the selection you have contains or is the section break character?

At the moment I select a page , collapse to the end , I want to know if the end of the page contains a section break or not.

I was going to use a method where I compare the section number at the end of the page , then move two characters forward , then check the section number. If they are different then the end of my page does have a section break - is there a better way to do it?

Thanks Chris

+2  A: 

Perhaps something on these lines:

Function HasBreak() As Boolean

With Selection.Find
    .Forward = True
    .Execute FindText:="^b"

    If .Found Then
        HasBreak = True
    End If
End With

End Function
Remou
A: 

Cheers that's a good suggestion.

The way I did it in the end was get the range of the page and section , check both "End" positions , if they were the same then the page contained the section break.

Chris