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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Find and Replace



 
 
Thread Tools Display Modes
  #1  
Old March 2nd, 2009, 10:27 PM posted to microsoft.public.word.newusers
Island Girl
external usenet poster
 
Posts: 227
Default Find and Replace

Find and Replace with wildcards is the most fascinating thing about Word to
me. After first studying Graham's article and receiving so much help from
you wonderful MVP's, I'm often able to apply it when I need to do so; other
times I have to ask you for help.

But for some reason I still don't totally understand the "but not" feature.
It drives me crazy!

Let's say for drill that I wish to capitalize every word in a paragraph
except those words starting with, say, the letter "N". I've tried arranging
the "but not" every which way and I never seem to get it right.

Is there some way to state the "but not" that I might not have heard before
but which might switch on the proverbial light bulb?

Thanks for being the only "book" I read on the subject of Word.
  #2  
Old March 3rd, 2009, 12:16 AM posted to microsoft.public.word.newusers
Greg Maxey[_2_]
external usenet poster
 
Posts: 649
Default Find and Replace

IG,

I wouldn't want his head to burst, but Graham was my Sensei with Find and
Replace as well ;-). The following would find all words that don't start
with "n" [!n]*

I don't think that this is one that you could use the UI Find and Replace.
It can be done with a macro though:

Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "[!n]*"
.MatchWildcards = True
While .Execute
oRng.Characters.First.Case = wdUpperCase
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub




--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org


"Island Girl" wrote in message
...
Find and Replace with wildcards is the most fascinating thing about Word
to
me. After first studying Graham's article and receiving so much help from
you wonderful MVP's, I'm often able to apply it when I need to do so;
other
times I have to ask you for help.

But for some reason I still don't totally understand the "but not"
feature.
It drives me crazy!

Let's say for drill that I wish to capitalize every word in a paragraph
except those words starting with, say, the letter "N". I've tried
arranging
the "but not" every which way and I never seem to get it right.

Is there some way to state the "but not" that I might not have heard
before
but which might switch on the proverbial light bulb?

Thanks for being the only "book" I read on the subject of Word.



  #3  
Old March 3rd, 2009, 04:08 PM posted to microsoft.public.word.newusers
Island Girl
external usenet poster
 
Posts: 227
Default Find and Replace

Hi, Greg:

I couldn't count how many times you've come to my rescue, and this is just
one more great big thank you!!

"Greg Maxey" wrote:

IG,

I wouldn't want his head to burst, but Graham was my Sensei with Find and
Replace as well ;-). The following would find all words that don't start
with "n" [!n]*

I don't think that this is one that you could use the UI Find and Replace.
It can be done with a macro though:

Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "[!n]*"
.MatchWildcards = True
While .Execute
oRng.Characters.First.Case = wdUpperCase
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub




--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org


"Island Girl" wrote in message
...
Find and Replace with wildcards is the most fascinating thing about Word
to
me. After first studying Graham's article and receiving so much help from
you wonderful MVP's, I'm often able to apply it when I need to do so;
other
times I have to ask you for help.

But for some reason I still don't totally understand the "but not"
feature.
It drives me crazy!

Let's say for drill that I wish to capitalize every word in a paragraph
except those words starting with, say, the letter "N". I've tried
arranging
the "but not" every which way and I never seem to get it right.

Is there some way to state the "but not" that I might not have heard
before
but which might switch on the proverbial light bulb?

Thanks for being the only "book" I read on the subject of Word.




  #4  
Old March 3rd, 2009, 04:19 PM posted to microsoft.public.word.newusers
Greg Maxey[_2_]
external usenet poster
 
Posts: 649
Default Find and Replace

You're welcome. I was wrong though. I have since figured out how it can be
done using the UI:

Find what: [!n]

this finds the first letter of any word that doesn't start with n.

Replace with:

^& (Note: This represents the content of the found range)

and format the replacement text with FontAll Caps


Island Girl wrote:
Hi, Greg:

I couldn't count how many times you've come to my rescue, and this is
just one more great big thank you!!

"Greg Maxey" wrote:

IG,

I wouldn't want his head to burst, but Graham was my Sensei with
Find and Replace as well ;-). The following would find all words
that don't start with "n" [!n]*

I don't think that this is one that you could use the UI Find and
Replace. It can be done with a macro though:

Sub ScratchMacro()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "[!n]*"
.MatchWildcards = True
While .Execute
oRng.Characters.First.Case = wdUpperCase
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub




--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org


"Island Girl" wrote in message
...
Find and Replace with wildcards is the most fascinating thing about
Word to
me. After first studying Graham's article and receiving so much
help from you wonderful MVP's, I'm often able to apply it when I
need to do so; other
times I have to ask you for help.

But for some reason I still don't totally understand the "but not"
feature.
It drives me crazy!

Let's say for drill that I wish to capitalize every word in a
paragraph except those words starting with, say, the letter "N".
I've tried arranging
the "but not" every which way and I never seem to get it right.

Is there some way to state the "but not" that I might not have heard
before
but which might switch on the proverbial light bulb?

Thanks for being the only "book" I read on the subject of Word.


--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org



 




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 08:27 AM.


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