About This Code
Brief Description:
Test Macro in MS Word to find Text
Contributor:
Claire Keller
Last Modified:
06 Dec 2004
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
Sub TestMacro
'
'TestMacro
'Test Macro
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "software"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Find.Execute
End Sub
Usage / Example
I was looking for some code to look for a certain word in a large MS Word doc. This was my 1st step in trying to locata words (text, no defined fields) in a Word doc so that I could then take those words and insert them into a Form in Notes with defined fields. Any additions, please add.