Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I'm trying to set up a macro (Word 2003) to do several replacements in a selection of my text with italics in the replacement field.
I.e. I have a certain number of words (non italic) that need to be replaced with another word in italic. I recorded the sequence for one of the words (actually, these are names of notes that need to be translated and italicized, ALA, BSI, etc.), and then copied it for each word. My problem is that the italics don't get inserted with the macro, though they appeared when I recorded it. Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "A" .Replacement.Text = "LA" .Forward = True .Wrap = wdFindStop .Format = True .MatchCase = True .MatchWholeWord = True .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll What do I need to add to get the italics? Many thanks! |
#2
![]() |
|||
|
|||
![]() Quote:
Thanks! |
#3
![]() |
|||
|
|||
![]()
Try removing this line:
Selection.Find.Replacement.ClearFormatting which removes the italic formatting from your replacement text. |
#4
![]() |
|||
|
|||
![]() Quote:
Selection.Find.Replacement.Font.Italic = True I got this line by recording the same macro in Word 2000. The mystery is why it doesn't appear when I record exactly the same thing in Word 2003, where I get this line instead: Selection.Find.Replacement.ClearFormatting Any explanation for this behavior? Thanks. |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro in Word 2003 | Microsoft Word Help | |||
Word 2003 macro | New Users | |||
Multiple Replacements | New Users | |||
WORD 2003 Macro | Microsoft Word Help | |||
Word 2003 macro and SendToPringer | Mailmerge |