![]() |
|
#1
|
||||
|
||||
![]() 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] |
![]() |
Tags |
macro, macro find and replace |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need Short Macro-Find and Replace | rsrasc | Word VBA | 2 | 11-10-2014 05:03 PM |
![]() |
amparete13 | PowerPoint | 3 | 03-11-2014 05:29 AM |
![]() |
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 |