#1
|
|||
|
|||
Automatically Inserting Brackets to EACH selected line
Hello guys,
I need to ask if it's possible to do amend on the below code related to Inserting Brackets I need to add the brackets in each bold sentences after selecting the same format Quote:
The problem with the code now it's adding the brackets for the last line only do you know or if it's possible to help on how I can add to each bold sentence only ? I would be appreciated for your time and effort Attachments area |
#2
|
||||
|
||||
Post a sample document and highlight the bits that you want the brackets on. Your screenshot shows bold headings and bold inside paragraphs as well as the bolded list.
If the parts you want bracketed are autoonumbered the code might be a bit complex
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Thanks for your fast feedback
please check again the photo with the highlighted parts I don't needed for header or lists or number just the normal text |
#4
|
||||
|
||||
This will may get your 'headings' as well if you didn't format them with built-in styles.
Code:
Sub BracketsOnBold() With Selection.Find .ClearFormatting .Font.Bold = True .ParagraphFormat.OutlineLevel = wdOutlineLevelBodyText 'this excludes headings .Replacement.ClearFormatting .Text = "" .Replacement.Text = "[^&]" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll End With End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#5
|
|||
|
|||
it works perfect no need for anything more than this, really appreciate your effort and your works thanks a lot sir you saved lots of time for me
|
#6
|
||||
|
||||
Cross-posted at: Automatically Inserting Brackets to EACH selected line (Word Doc.) - Microsoft: Office - Tek-Tips
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
macro edit, macro multiple functions |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
syntax for inserting blank line before inserting table and after a line or paragraph | SamDsouza | Word VBA | 8 | 08-04-2019 11:10 PM |
How to move a line to another line that starts with a chain selected in the 1st one? | gloub | Word VBA | 24 | 03-19-2019 03:12 PM |
find and delet all text within brackets and the brackets themselves | wrdy | Word | 2 | 08-03-2017 06:55 PM |
macro to add brackets to each line and add single quotes to each word in the line | bracketandquotes | Word VBA | 17 | 02-16-2015 03:51 PM |
Inserting nested brackets in a field code deletes numeration | piotrek99 | Word | 1 | 11-02-2014 01:15 PM |