Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Need a macro to put borders around every occurrence of a word
I want to find several different words in a document, an dhighlight them with
a border (box). I have treid the following section ( with help from the macro recorder) to do this, but get "Invlaid Use of Propert"y error on the Borders. how do I appy the border to the found items? With Selection.Find .Text = "SYSTEM:" .Replacement.Text = "SYSTEM:" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = True .Replacement.Font.Borders (1) .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Thanks. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Need a macro to put borders around every occurrence of a word
It's not unusual for the macro recorder to botch the job. See
http://www.word.mvps.org/FAQs/Macros...ordedMacro.htm. Here's code that works: With Selection.Find .Text = "SYSTEM:" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = True .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False Do While .Execute Selection.Borders.Enable = True Loop End With -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. Wiley wrote: I want to find several different words in a document, an dhighlight them with a border (box). I have treid the following section ( with help from the macro recorder) to do this, but get "Invlaid Use of Propert"y error on the Borders. how do I appy the border to the found items? With Selection.Find .Text = "SYSTEM:" .Replacement.Text = "SYSTEM:" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = True .Replacement.Font.Borders (1) .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Thanks. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Need a macro to put borders around every occurrence of a word
I knew it was simple. I am much better with Excel VBA. This is my first
attempt at Word VBA. You saved me many hours. Thanks. "Jay Freedman" wrote: It's not unusual for the macro recorder to botch the job. See http://www.word.mvps.org/FAQs/Macros...ordedMacro.htm. Here's code that works: With Selection.Find .Text = "SYSTEM:" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = True .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False Do While .Execute Selection.Borders.Enable = True Loop End With -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. Wiley wrote: I want to find several different words in a document, an dhighlight them with a border (box). I have treid the following section ( with help from the macro recorder) to do this, but get "Invlaid Use of Propert"y error on the Borders. how do I appy the border to the found items? With Selection.Find .Text = "SYSTEM:" .Replacement.Text = "SYSTEM:" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = True .Replacement.Font.Borders (1) .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Thanks. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Converting WordPerfect 12 files to Word 2003 | New Users | |||
I am having difficulty with deleting headers and footers | New Users | |||
glossary macro in Word? | Microsoft Word Help | |||
hard space between words. | Microsoft Word Help | |||
Word should allow to 'divide' page by 3 or 4, not just 2 | Page Layout |