View Single Post
 
Old 01-31-2014, 02:31 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

This finds text between quotes and bolds the text leaving the quotes unbolded:

Code:
Sub SearchInQuotes()
Dim bWC As Boolean
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
With oRng.Find
.MatchWildcards = True
'find curly
'.Text = "^0147*^0148"
'Find straight
'.Text = "^34*^34"
'Find both
.Text = "[^34^0147]*[^34^0148]"
While .Execute
oRng.MoveStart wdCharacter, 1
oRng.MoveEnd wdCharacter, -1
oRng.Font.Bold = True
oRng.Collapse wdCollapseEnd
Wend
End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote