Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Find and Replace feature when recording a Macro
How can I use the Find and Replace feature when recording a Macro? I am
trying to set up a macro that will find a series of like words in a document and bold them for quick recognition. |
#2
|
|||
|
|||
Using the macro recorder to record a Find and Replace action produces some
really ugly code. This is how you would do it starting from scratch: Dim myrange As Range Selection.HomeKey wdStory Selection.Find.ClearFormatting With Selection.Find Do While .Execute(FindText:="yourword", MatchWildcards:=False, _ Wrap:=wdFindStop, Forward:=True) = True Set myrange = Selection.Range myrange.Font.Bold = True Loop End With -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "WCRicster" wrote in message ... How can I use the Find and Replace feature when recording a Macro? I am trying to set up a macro that will find a series of like words in a document and bold them for quick recognition. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mega macro with find and replace (HELP!) | Microsoft Word Help | |||
Find and Replace GREEK symbols in XP, 2K & 97 | Microsoft Word Help | |||
Problem with function "Find and Replace" in Word. | Microsoft Word Help | |||
how can I carry out a find and replace within a Word header | Microsoft Word Help | |||
Find and Replace anomaly | Microsoft Word Help |