Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
find capitalized words and replace with a text
I need a macro that do this in MS Word 2007
in the selected part of text to: - find any words whose all LETTERS are capitalized (so Canada for example should not be found, but CANADA should be) - and replaces all those instances with a text , for example string "HERE" I wonder if anybody could help with that? Mark |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
find capitalized words and replace with a text
Mark,
Sub ScratchMacro() Dim oRng As Word.Range Set oRng = Selection.Range With oRng.Find .Text = "[A-Z]@" .MatchWildcards = True .Replacement.Text = "HERE" .Execute Replace:=wdReplaceAll End With End Sub Note "I" in your example will also be replaced with "HERE" -- Greg Maxey See my web site http://gregmaxey.mvps.org for an eclectic collection of Word Tips. "mark20090901" u54447@uwe wrote in message news:9b7a75bfa7243@uwe... I need a macro that do this in MS Word 2007 in the selected part of text to: - find any words whose all LETTERS are capitalized (so Canada for example should not be found, but CANADA should be) - and replaces all those instances with a text , for example string "HERE" I wonder if anybody could help with that? Mark |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
find capitalized words and replace with a text
Well if you use Find and Replace to simply find ANY instance of canada
regardless of capitalisation and Replace it with Canada, then it should do what you want. It doesn't matter that it will find Canada and replace it, because it replaces it with Canada anyway. Just keep the F&R dead simple. -- Terry Farrell - MSWord MVP "mark20090901" u54447@uwe wrote in message news:9b7a75bfa7243@uwe... I need a macro that do this in MS Word 2007 in the selected part of text to: - find any words whose all LETTERS are capitalized (so Canada for example should not be found, but CANADA should be) - and replaces all those instances with a text , for example string "HERE" I wonder if anybody could help with that? Mark |
#4
Posted to microsoft.public.word.newusers
|
|||
|
|||
find capitalized words and replace with a text
He doesn't want to replace it with "Canada," though.
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Terry Farrell" wrote in message ... Well if you use Find and Replace to simply find ANY instance of canada regardless of capitalisation and Replace it with Canada, then it should do what you want. It doesn't matter that it will find Canada and replace it, because it replaces it with Canada anyway. Just keep the F&R dead simple. -- Terry Farrell - MSWord MVP "mark20090901" u54447@uwe wrote in message news:9b7a75bfa7243@uwe... I need a macro that do this in MS Word 2007 in the selected part of text to: - find any words whose all LETTERS are capitalized (so Canada for example should not be found, but CANADA should be) - and replaces all those instances with a text , for example string "HERE" I wonder if anybody could help with that? Mark |
#5
Posted to microsoft.public.word.newusers
|
|||
|
|||
find capitalized words and replace with a text
Thanks a lot, I appreciate your help!
In the meantime I found this macro is working OK for me. (my intention was to change any word in the selected text to a big dot, word "Canada" was just an example here. Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find.Replacement.Font .Size = 18 .Bold = True .Color = wdColorRed End With With Selection.Find .Text = "[A-Z]*[A-Z]" .Replacement.Text = " €¢ " .Forward = True .Wrap = wdFindStop .Format = True .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True End With Selection.Find.Execute Replace:=wdReplaceAll Selection.MoveDown Unit:=wdLine, Count:=1 Best regards, Mark |
#6
Posted to microsoft.public.word.newusers
|
|||
|
|||
find capitalized words and replace with a text
When the new Windows 7 is expected to be on the retail stores for sale? Any
idea of the retail prices? Will the Office Professional 2007 programs work well with it (I bet it will, since they are from the same company. Any anticipated problems? Slowness in old computers?) "mark20090901" u54447@uwe wrote in message news:9b7a75bfa7243@uwe... I need a macro that do this in MS Word 2007 in the selected part of text to: - find any words whose all LETTERS are capitalized (so Canada for example should not be found, but CANADA should be) - and replaces all those instances with a text , for example string "HERE" I wonder if anybody could help with that? Mark |
#7
Posted to microsoft.public.word.newusers
|
|||
|
|||
find capitalized words and replace with a text
Public release of Win 7 is due 22 October. You can pre-order Win 7 Home
Premium from Tesco for £70 ( with double club card points) now - only while stock last. There's going to be a triple home pack introductory offer coming on the shelves shortly for a limited period pre-offer (£150). Search the usual suspects such as Amazon for the best offers. Pre-ordering will be cheaper. It will run on any PC that runs Vista but better. I have no problems with it running on a Netbook. If it can run on a Netbook designed for Win XP, then it will run on most low powered compatible PCs. You can download the Compatibility Checker from Microsoft. You'll also find full details of version and upgrades available on the MS site. -- Terry Farrell - MSWord MVP "Octavio" wrote in message ... When the new Windows 7 is expected to be on the retail stores for sale? Any idea of the retail prices? Will the Office Professional 2007 programs work well with it (I bet it will, since they are from the same company. Any anticipated problems? Slowness in old computers?) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
find & replace a word and change text color of found words | Microsoft Word Help | |||
Find and Replace all words that have a certain value in them, not just the value itself. | Microsoft Word Help | |||
How do i find and replace words in parenthesis? | Microsoft Word Help | |||
Trying to replace words with fields using Find/Replace | Microsoft Word Help | |||
Find/ Replace is auto-capping the words I want to replace with | Microsoft Word Help |