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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|