Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Mark Mark is offline
external usenet poster
 
Posts: 182
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find multiple characters in one find using MSword find/replace Cliff Microsoft Word Help 2 October 29th 06 07:48 PM
Find & Replace &vba: formatting, like bold [email protected] Microsoft Word Help 4 March 20th 06 11:00 AM
Find & Replace does not find formatting Ed Microsoft Word Help 5 April 1st 05 12:33 AM
Find Replace bold formatting with delimiter Steve Microsoft Word Help 7 December 7th 04 03:41 PM
Find Replace bold formatting with delimiter Steve New Users 7 December 7th 04 03:41 PM


All times are GMT +1. The time now is 01:14 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"