View Single Post
 
Old 03-27-2024, 08:49 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Demo below is Microsoft example of the "Found" property. DemoII below is my code which to me proves that "Found" is utterly useless:


Code:
Sub Demo()
  With Selection.Find
   .ClearFormatting
   .Font.Bold = True
   .Execute FindText:="Hello", Format:=True, Forward:=True
   If .Found = True Then
    .Parent.Expand Unit:=wdParagraph
    .Parent.Copy
   End If
End With
End Sub
Sub DemoII()
  With Selection.Find
    .ClearFormatting
    .Font.Bold = True
    If .Execute(FindText:="Hello", Format:=True, Forward:=True) Then
      .Parent.Expand Unit:=wdParagraph
      .Parent.Copy
    End If
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote