Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a Macro in Word to search for a string of Characters

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Need to search for a string of Char and Capitalize them using a macro for word

Thanks

dave
 
Here's a Word macro...

Sub Demo(ByVal strSearch As String)
Dim myRange As Range

Set myRange = Selection.Range

ActiveDocument.Select
With Selection.Find
.Text = strSearch
.Replacement.Text = UCase(strSearch)
.Forward = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

myRange.Select

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top