Thread: [Solved] Search Button
View Single Post
 
Old 06-01-2020, 06:40 PM
bscott221 bscott221 is offline Windows 10 Office 2019
Novice
 
Join Date: Jun 2020
Posts: 1
bscott221 is on a distinguished road
Default Search Button

I want to create a Text box and Search button in ms word. When I enter text in the search box and click the search button the code should find the text searched for. I tried the following code but it is not working.



Public Sub FindWord(sWord As String)
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = sWord
.Execute
End With
End Sub


Any help would be greatly appreciated. Thank you.
Reply With Quote