![]() |
|
#1
|
|||
|
|||
|
Hello,
I am new to VBA and struggling to combine code from different sources. I have a sort of a report that is comprised of several lines of text, that can be considered as parapgraphs. I need to add a box line, or single cell line arround each paragraph, takes much time if there are many. I have managed to do something with this code, but this applies border around each line, instead of paragraph. Dim rng As Range Dim brd As Border Set rng = ActiveDocument.Range With rng.Find .Text = "Paragraph_starting_word*^13" .MatchWildcards = True Do While .Execute For Each brd In rng.Paragraphs.Borders With brd .LineStyle = wdLineStyleSingle End With Next brd rng.Collapse wdCollapseEnd rng.End = ActiveDocument.Range.End Loop End With I would appreciate help. |
| Tags |
| microsoft word, paragraph formatting, vba macro |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| macro to insert paragraph | Hockey | Word VBA | 5 | 01-28-2020 06:21 AM |
VBA / macro to set paragraph spacing
|
paulkaye | Outlook | 4 | 01-23-2017 06:21 AM |
| Get paragraph number from macro | brice | Word VBA | 4 | 06-30-2015 03:29 AM |
Macro to set page borders
|
Jennifer Murphy | Word VBA | 1 | 11-04-2012 02:45 AM |
Page-crossing borders in a table with hidden between-cell borders
|
tenpaiman | Word | 2 | 08-08-2012 07:20 PM |