Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Find/Replace formatting
In Word 2003, is there a way to reformat all occurrences of *part* of
recurring text? Specifically, I want all occurrences of [sic] to be replaced with *only* sic in italics (not the brackets). I do not want to replace every occurrence of 'sic' since it is part of such words as basic. I've tried using EditReplaceFormatFont, but I can't find a way to replace *only* 'sic' and not the brackets, without replacing the occurrences of this sequence of letters in other words. Any help is much appreciated. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Find/Replace formatting
You need to use wildcards.
After checking the 'Use wildcards' box, enter in the Find What box (\[)(sic)(\]) Enter in the Replace With box \2 and press Ctrl+I to turn on italic formatting for the replacement. Then click the Replace All button. The article http://www.gmayor.com/replace_using_wildcards.htm will explain what the various parts of these expressions do. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. On Sat, 10 Mar 2007 15:04:02 -0800, Mark wrote: In Word 2003, is there a way to reformat all occurrences of *part* of recurring text? Specifically, I want all occurrences of [sic] to be replaced with *only* sic in italics (not the brackets). I do not want to replace every occurrence of 'sic' since it is part of such words as basic. I've tried using EditReplaceFormatFont, but I can't find a way to replace *only* 'sic' and not the brackets, without replacing the occurrences of this sequence of letters in other words. Any help is much appreciated. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Find/Replace formatting
If you want to retain the upright square brackets, (Jay's method will remove
the brackets) then you will need to do this in at least two stages. The following macro will retain the upright brackets and italicise 'sic' between them. It works here by replacing the square brackets with unique strings and italicising the lot, then replacing the unique strings with the left and right upright brackets. This allows for the fact that you may have used square brackets elsewhere. http://www.gmayor.com/installing_macro.htm Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "\[(sic)\]" .Replacement.Text = "#&#&#\1#@#@#" .Replacement.Font.Italic = True .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = True .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "#&#&#" .Replacement.Text = "[" .Replacement.Font.Italic = False .MatchWildcards = False End With Selection.Find.Execute replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "#@#@#" .Replacement.Text = "]" .Replacement.Font.Italic = False .MatchWildcards = False End With Selection.Find.Execute replace:=wdReplaceAll -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Mark wrote: In Word 2003, is there a way to reformat all occurrences of *part* of recurring text? Specifically, I want all occurrences of [sic] to be replaced with *only* sic in italics (not the brackets). I do not want to replace every occurrence of 'sic' since it is part of such words as basic. I've tried using EditReplaceFormatFont, but I can't find a way to replace *only* 'sic' and not the brackets, without replacing the occurrences of this sequence of letters in other words. Any help is much appreciated. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find multiple characters in one find using MSword find/replace | Microsoft Word Help | |||
Find & Replace &vba: formatting, like bold | Microsoft Word Help | |||
Find & Replace does not find formatting | Microsoft Word Help | |||
Find Replace bold formatting with delimiter | Microsoft Word Help | |||
Find Replace bold formatting with delimiter | New Users |