DrTribos
asked on
Macro to find borders around words in a document
Hi I am trying to work with some code by Chris Bottomley
( https://www.experts-exchange.com/questions/26306297/VBA-Word-code-to-find-a-border-around-text.html?anchorAnswerId=34540514#a34540514 ).
I have created a simple document - put a border around a word - run the macro... and was left perplexed
Cheers, Steve
( https://www.experts-exchange.com/questions/26306297/VBA-Word-code-to-find-a-border-around-text.html?anchorAnswerId=34540514#a34540514 ).
I have created a simple document - put a border around a word - run the macro... and was left perplexed
Sub getBord()
Dim wrd As Object
For Each wrd In ThisDocument.Words
If wrd.Borders(wdBorderTop).Visible Then MsgBox "Do Something with " & wrd
Next
End Sub
... any help appreciated. Cheers, Steve
ASKER
Hi Flyster
Thanks for your reply... perhaps there is something wrong with my copy of Word... I have a test document with 2x words that have borders. I put the borders around the words using the following procedures.
Word1:
d.click to select word
press border button corresponding to outside border
Word2:
d.click to select word
Format>Borders & Shading>Borders
Apply "Box" border, apply to text > OK
When I run your macro I get: You have 0 word(s) with border(s)
ouch :-(
Steve
Thanks for your reply... perhaps there is something wrong with my copy of Word... I have a test document with 2x words that have borders. I put the borders around the words using the following procedures.
Word1:
d.click to select word
press border button corresponding to outside border
Word2:
d.click to select word
Format>Borders & Shading>Borders
Apply "Box" border, apply to text > OK
When I run your macro I get: You have 0 word(s) with border(s)
ouch :-(
Steve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As my solution was not excepted, I believe the points should be refunded.
ASKER
Reason for accepting own solution: issue solved as stated above
Flyster
Open in new window