Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 09-01-2014, 08:50 PM
macropod's Avatar
macropod macropod is offline Find and Replace "find what text" Windows 7 64bit Find and Replace "find what text" Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your original post didn't mention anything about track changes. To work with those, you'd need to use a macro that, instead of replacing the found string, inserts the brackets before & after:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "<[0-9]{4}>"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
    .Execute
  End With
  Do While .Find.Found
    .InsertBefore "("
    .InsertAfter ")"
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace &quot;find what text&quot; Help with the "find and replace" option; character problem martinn4 Word 3 02-20-2014 03:52 AM
can find and replace instances of the "enter" key? snunicycler Word 7 05-02-2013 11:54 PM
Find and Replace &quot;find what text&quot; Word Macro to find and delete rows that contain adjacent cells containing "." AlexanderJohnWilley Word VBA 7 11-08-2012 10:15 AM
Find and Replace &quot;find what text&quot; Is there a way to use "find/replace" to find italics words? slayda Word 3 09-14-2011 02:16 PM
Find and Replace &quot;find what text&quot; Find & Replace words with "/" prefix & suffix tollanarama Word 4 01-25-2011 02:19 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:12 PM.


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