Find & Replace Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro recorded to find the word "text" and replace it with "text"
(in italic). When I am recording the macro it works find, when I run the
macro the italic is not applied?
 
There are limits to what you can do with a recorded macro. You might see
http://word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm.

I suspect there must be something more involved here than you describe,
however, since I can't see that having a macro would save much time over
typing "text" in the Find What box and typing ^& and pressing Ctrl+I in the
Replace With box.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
The Macro recorder is not perfect. In this case there is a bug (which, I'm
happy to be able to say, has been fixed in Word 2007) which means that the
setting of the Replacement Font is not recorded.

You need to add this line:

Selection.Find.Replacement.Font.Italic = True

.. to your recorded macro - somewhere before the line that begins
Selection.Find.Execute
 
Back
Top