![]() |
|
#11
|
|||
|
|||
|
Shelley
We will have to drop back and check each found instance to ensure is starts at the beginning of the paragraph. 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 = wdFindStop
.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:=wdReplaceOne
'Bold terms
.Text = "([a-zA-Z0-9][!^13]@)([^t:])"
.Replacement.Text = "\1^t"
.Replacement.Font.Bold = True
While .Execute
If oRng.Characters(1).Start = oRng.Paragraphs(1).Range.Characters(1).Start Then
oRng.Font.Bold = True
oRng.Text = Replace(oRng.Text, ":", vbTab)
End If
Wend
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 |