View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default macro or find/replace

The difficult bit is going to be identifying when one font follows another
specific font which Word's replace function does not allow for. It is simple
enough to find when the font changes to Arial Narrow and insert a tab in
front. Cindy has almost covered that. You don't actually need a macro, but

Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Font.Name = "Arial Narrow"
.Replacement.Text = "^t^&"
.Forward = True
.Wrap = wdStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute replace:=wdReplaceAll

will put a tab before every instance of Arial Narrow.

ie enter no text in the find box - replace with ^t^&


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Janey wrote:
I have a long doc and would like to do the following:

Add a tab after every instance of a space in one font and a letter in
a different font
ie. Arial Black word or words followed by a space (add tab here)
Arial Narrow word or words.

Is there any way to do this?

Thx. for any help.