![]() |
|
#10
|
|||
|
|||
|
Hi Greg, thank you so much for the updated code. I've run it on a larger set of definitions to be converted and a few things happened. I've added 0-9 to the code to deal with legislation definitions that start with a number. It has also boldened some text it shouldn't and has removed the colon from these also.
'this Lease' hasn't picked up the word 'this' which I suspect is because the code is only looking for initial caps. Non-Structure Alteration at sub level (b) its changed the line to bold and has removed the colon and inserted a tab - same for Property and Regulations - is this because there are initial cap words within the sentence? TEST RUN.docx Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchWildcards = True
.Replacement.ClearFormatting
'Get rid of quotes
.text = "(" & Chr(34) & ")([A-Z0-9][!^13]@)(" & Chr(34) & ")([ ^t:])"
.Replacement.text = "\2^t"
.Execute Replace:=wdReplaceAll
'Bold terms
.text = "([A-Z0-9][!^13]@)([^t:])"
.Replacement.text = "\1^t"
.Replacement.Font.Bold = True
.Execute Replace:=wdReplaceAll
End With
lbl_Exit:
Exit Sub
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bold Term Macro that DOES NOT bold terms with Quotation Marks | NotOriginal | Word VBA | 2 | 03-14-2024 02:22 PM |
| Bold Header if it is not Bold (Check to see if it is Bold) | armendarizj | Word | 2 | 01-06-2022 05:45 PM |
bold (or unbold) section of text instead of bold toggling
|
Burt | Word | 6 | 04-06-2019 09:09 AM |
Text in #1 is made bold, rest of the document is edited, text in #1 is now not bold
|
footer-assistance | Word | 1 | 06-29-2015 03:49 AM |
Not Bold text but it comes up bold
|
Pluviophile | Word | 7 | 10-22-2013 10:29 AM |