Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub TestWordVBA()
Dim MyDoc As Object
Dim done As Boolean
Dim MyStr As String
done = False 'Control value for loop
'Setting search string
MyStr = InputBox("Enter search string value: ", _
"Find String")
'Loop will execute as long as another search string exists
While Not (done)
Selection.Find.ClearFormatting
With Selection.Find
.Text = MyStr
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
'If another word is found, then continue
If Not (Selection.Find.Execute) Then
done = True
Else
'Deleting search string from document
Selection.Delete Unit:=wdCharacter, Count:=1
End If
Wend
'Creating new/blank document
Set MyDoc = Documents.Add
Selection.TypeText Text:="This is my new document."
End Sub