Perhaps something like this:
Code:
Option Explicit
Sub YourLargerMacro()
If fcnXorY Then
MsgBox "Do x"
Else
MsgBox "Do y"
End If
lbl_Exit:
Exit Sub
End Sub
Function fcnXorY() As Boolean
'A basic Word Macro coded by Gregory K. Maxey
Dim oRngStart As Range, oRng As Range
Dim bDo_x As Boolean
bDo_x = False
Set oRngStart = Selection.Range
Set oRng = ActiveDocument.Bookmarks("\Page").Range
With oRng.Find
.Text = "^m"
If .Execute Then
bDo_x = True
Else
With oRng.Find
.Text = "^b"
Do While .Execute
oRng.Collapse wdCollapseEnd
oRng.Select
If Selection.Sections(1).PageSetup.SectionStart <> wdSectionContinuous Then
bDo_x = True
Exit Do
End If
Loop
End With
End If
End With
oRngStart.Select
lbl_Exit:
Exit Function
End Function