Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 01-31-2014, 02:31 PM
gmaxey gmaxey is offline replace words between two symbols Windows 7 32bit replace words between two symbols Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
replace words between two symbols Replace words within headers in multiple document Carchee Word VBA 14 12-19-2013 04:36 PM
replace words between two symbols Highlight and then replace multiple words redhin Word VBA 5 03-05-2013 05:42 AM
replace words between two symbols Macro to replace few words in the document ubns Word VBA 7 08-16-2012 10:33 PM
replace words between two symbols Find and Replace - symbols clisco Word 5 01-03-2010 05:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft