Template:Wikifier macro: Difference between revisions

From The Jolly Contrarian
Jump to navigation Jump to search
Created page with " ' Wikifier Macro ' ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "{{{article}}}" .Repl..."
 
No edit summary
 
Line 1: Line 1:
  ' Wikifier Macro
  Sub Wikifier
  '
  {{Wikifier|{{{template}}}|{{{article}}}}}
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "{{{article}}}"
        .Replacement.Text = "<nowiki>{{{{{template}}}|{{{article}}}}}</nowiki>"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = True
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
  End Sub
  End Sub

Latest revision as of 23:29, 19 January 2020

Sub Wikifier
   With Selection.Find
       .Text = "{{{article}}}"
       .Replacement.Text = "{{{{{template}}}|{{{article}}}}}"
       .Forward = True
       .Wrap = wdFindContinue
       .Format = False
       .MatchCase = True
       .MatchWholeWord = False
       .MatchWildcards = False
       .MatchSoundsLike = False
       .MatchAllWordForms = False
   End With
   Selection.Find.Execute Replace:=wdReplaceAll
End Sub