Your question is short on context, but maybe
Code:
Function InField(sText As String) As Boolean
If Selection.Fields.Count > 0 Then
If Selection.Fields(1).Type = wdFieldFormula Then
If InStr(1, Selection.Fields(1).Code, sText) > 1 Then InField = True
End If
End If
End Function