A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Page Layout
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Need to "find" an entire word and "replace" only part of it



 
 
Thread Tools Display Modes
  #11  
Old June 20th, 2004, 03:40 AM
Suzanne S. Barnhill
external usenet poster
 
Posts: n/a
Default Need to "find" an entire word and "replace" only part of it

If you need it to match just the font (Arial Regular, TNR Italic) and not
the font size, then you'll need to go with the two-step F&R, I'm afraid.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"VictorD" wrote in message
news
Yes Susan you are correct. Any ideas how to get the font to paste
correctly? If I put a formatted 11pt font on the clipboard, that is what it
pastes. So it overwrites for instance a heading that may have a different
font.

--
~Vic


"Suzanne S. Barnhill" wrote:

Actually, Graham's approach is by far the simplest. Perhaps that's the

one
you meant?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the

newsgroup so
all may benefit.

"VictorD" wrote in message
...
Thanks all. I have tried the simpler approach that Greg provided as

well
as the "dual pass" approach from Garfiled-n-odie.

Here is my status:
When trying Greg's approach, I typed the entry on the top of the page

and
cut it to the clipboard, the did a "findhighlight all in document" then

am
pasting to relace all selected text.
the wrong font size unfortunatly pastes throughout the document.

(understanding I would like to make a macro with this)

I was successful with the two pass approach from Garfiled-n-Odie but

am
having issues getting the macro to replicate my manual steps. This

however
is successfully adjusting the font size to the target.

Sincere thanks for the help you all have been. This seems like a

no-big-deal thing but is a constant burden.
---
~Vic


---
"VictorD" wrote:

Greetings,
This is easy for me to communicate wrong so I will try to be careful
in my description.

I have many documents that have a brand-name within it that needs to
be formatted with half of the word in an Arial font and half of the
word needs to be "Times Roman, Italicized". The first letter of the
word needs to be uppercase. This is constantly done wrong in

documents
(because it is a pain) so documents are violating branding

standards.

I would like to use Word to find all instances of the brand-name
(regardless of the formatting and replace them with properly

formatted
text.

I can find how to format an entire word with a formatted text. I
cannot find how to do a combination of fonts within a word nor can I
figure-out how to make the first letter upper-case.

If I can figure this out I can make a macro and place a button on

the
toolbar. It would be so cool.

~vic




  #12  
Old June 20th, 2004, 08:24 AM
Graham Mayor
external usenet poster
 
Posts: n/a
Default Need to "find" an entire word and "replace" only part of it

I thought the whole idea was to replace the font?

Provided the font *size* remains the same, the technique can easily be put
into a macro. All you need to do is save the formatted text as an autotext
entry, then the following macro will work:

Selection.HomeKey Unit:=wdStory
NormalTemplate.AutoTextEntries("Brandname").Insert _
Whe=Selection.Range, RichText:=True
Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
Selection.Cut
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Put the name to find here"
.Replacement.Text = "^c"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

If font size is important then you will have to try the double pass approach
as suggested by Suzanne.
Do you have problems reading our names

--

Graham Mayor - Word MVP

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




VictorD wrote:
Yes Susan you are correct. Any ideas how to get the font to paste
correctly? If I put a formatted 11pt font on the clipboard, that is
what it pastes. So it overwrites for instance a heading that may have
a different font.


Actually, Graham's approach is by far the simplest. Perhaps that's
the one
you meant?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so
all may benefit.

"VictorD" wrote in message
...
Thanks all. I have tried the simpler approach that Greg provided as
well

as the "dual pass" approach from Garfiled-n-odie.

Here is my status:
When trying Greg's approach, I typed the entry on the top of the
page and

cut it to the clipboard, the did a "findhighlight all in document"
then am
pasting to relace all selected text.
the wrong font size unfortunatly pastes throughout the document.

(understanding I would like to make a macro with this)

I was successful with the two pass approach from Garfiled-n-Odie
but am

having issues getting the macro to replicate my manual steps. This
however
is successfully adjusting the font size to the target.

Sincere thanks for the help you all have been. This seems like a

no-big-deal thing but is a constant burden.
---
~Vic


---
"VictorD" wrote:

Greetings,
This is easy for me to communicate wrong so I will try to be
careful
in my description.

I have many documents that have a brand-name within it that needs
to
be formatted with half of the word in an Arial font and half of the
word needs to be "Times Roman, Italicized". The first letter of the
word needs to be uppercase. This is constantly done wrong in
documents (because it is a pain) so documents are violating
branding standards.

I would like to use Word to find all instances of the brand-name
(regardless of the formatting and replace them with properly
formatted
text.

I can find how to format an entire word with a formatted text. I
cannot find how to do a combination of fonts within a word nor can
I
figure-out how to make the first letter upper-case.

If I can figure this out I can make a macro and place a button on
the
toolbar. It would be so cool.

~vic



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.