#1   Report Post  
Posted to microsoft.public.word.docmanagement
Janey
 
Posts: n/a
Default macro or find/replace

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.

  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M -WordMVP-
 
Posts: n/a
Default macro or find/replace

Hi Janey,

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?

Go into Edit/Replace and click on the "More" button. Click in the "Find"
field, go to the "Format" button, choose "Font" and select the font you
want to find. Type in the text you want to find. Now enter the Replace
information. If you test using "Find next" you should see that only text
formatted with the chosen font is found.

To later search with no formatting, click the "No formatting" button
with the focus in the Find field.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)

  #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.



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
Form Generaters in Word Graham Beaumont Microsoft Word Help 2 May 17th 06 07:11 PM
macro asking for word to find/replace [email protected] Microsoft Word Help 3 October 28th 05 03:39 PM
Set up find/replace in a macro Haydon Microsoft Word Help 3 June 29th 05 11:07 AM
Macro to Find/Replace (with MailMerge Field)? aiyou Mailmerge 1 December 8th 04 07:39 AM
2000 to 2002 macro and "Could not open macro storage" Art Farrell Mailmerge 1 December 6th 04 12:40 PM


All times are GMT +1. The time now is 12:48 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"