View Single Post
 
Old 10-11-2024, 09:52 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Shelley Lou, please, try this:
Code:
Sub PlainDefinition_FormatBold()
'Select one or more definitions with plain text and plain quotes and format bold
Dim rng As range
Application.ScreenUpdating = False
If selection.Type = wdSelectionIP Then
 'MsgBox Prompt:="You have not selected any text!"
 MsgBox "You have not selected any text!", vbExclamation, "Invalid selection"
 Exit Sub
End If
Set rng = selection.range
With rng.Find
   .ClearFormatting
   .Replacement.ClearFormatting
   .Forward = False
   .Wrap = wdFindStop
   .Format = True
   .MatchWildcards = True
   .text = "[""""]*[""""]" 'Find any text within quotes
   .Replacement.Font.Bold = True 'Replacement text is bold
   .Execute Replace:=wdReplaceAll
   .text = "\([""""]*[""""]\)" 'Find any text within quotes within brackets
   .Replacement.Font.Bold = True
   .Execute Replace:=wdReplaceAll
   End With
   Application.ScreenUpdating = True
  Set rng = Nothing
 End Sub
Note: instead of """" you may use "" in all occurrences. Tip: If you want to embolden a selected range, you don't need a macro - just press Alt+B.
And the final remark: in your sample (...by the Landlord to the Tenant in writing") the " is an orphan (= it is not paired), so it could cause false emboldening.
Reply With Quote