Template:Wikifer definition macro: Difference between revisions

From The Jolly Contrarian
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
     With Selection.Find
     With Selection.Find
         .Text = ChrW(8220) & "([a-z,A-Z,0-9, ]{1,})" & ChrW(8221)
         .Text = ChrW(8220) & "([a-z,A-Z,0-9, ]{1,})" & ChrW(8221)
         .Replacement.Text = ChrW(8220) & "'''<nowiki>{{{{{1}}}|\1}}</nowiki>'''" & ChrW(8221 _
         .Replacement.Text = ChrW(8220) & "<nowiki>'''{{{{{1}}}prov|\1}}'''</nowiki>" & ChrW(8221 _
             )
             )
         .Forward = True
         .Forward = True

Revision as of 22:05, 20 January 2020

Sub Wikifier definition 
 Selection.Find.ClearFormatting
   Selection.Find.Replacement.ClearFormatting
   With Selection.Find
       .Text = ChrW(8220) & "([a-z,A-Z,0-9, ]{1,})" & ChrW(8221)
       .Replacement.Text = ChrW(8220) & "'''{{{{{1}}}prov|\1}}'''" & ChrW(8221 _
           )
       .Forward = True
       .Wrap = wdFindAsk
       .Format = False
       .MatchCase = False
       .MatchWholeWord = False
       .MatchAllWordForms = False
       .MatchSoundsLike = False
       .MatchWildcards = True
   End With
   Selection.Find.Execute Replace:=wdReplaceAll
End Sub