Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-04-2016, 04:22 PM
macropod's Avatar
macropod macropod is offline Find and Replace Macro Need Windows 7 64bit Find and Replace Macro Need 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


You don't need a macro for this - it can be done with a wildcard Find/Replace, where:
Find = (\]\])([!^13\]]@)^13
Replace = \1{{field-on:Bible}}\2{{field-off:Bible}}^p
That said, you could simply replace your existing Find/Replace parameters with the above:
Code:
Sub LogosField()
'
' LogosField Macro
'
Application.ScreenUpdating = False
With ActiveDocument.Content.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Forward = True
  .Format = False
  .Wrap = wdFindContinue
  .MatchWildcards = True
  .Text = "(\]\])([!^13\]]@)^13"
  .Replacement.Text = "\1{{field-on:Bible}}\2{{field-off:Bible}}^p"
  .Execute Replace:=wdReplaceAll
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
macro, macro find and replace



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Short Macro-Find and Replace rsrasc Word VBA 2 11-10-2014 05:03 PM
Find and Replace Macro Need Find and Replace Macro amparete13 PowerPoint 3 03-11-2014 05:29 AM
Find and Replace Macro Need Is the following too complex for find/replace macro? bertietheblue Word VBA 12 11-04-2013 05:35 PM
macro or find/replace JamesVenhaus Word 2 02-27-2012 03:34 PM
Find and Replace Macro - A Better Way Tribos Word VBA 0 10-08-2008 03:22 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:47 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