View Single Post
 
Old 03-16-2022, 05:57 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote