Â
L’exemple suivant cherche dans la Sélection le mot ‘mot’ et surligne chaque paragraphe trouvé. Pour une recherche dans tout le document faire d’abord Ctrl+A.
Â
 Public Sub toto()
'macro écrite par guy moncomble
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
     .MatchWildcards = True
     .Text = "[M,m]ot" 'le mot peut avoir une majuscule
          While .Execute
               Selection.Paragraphs(1).Range.Select
               Selection.Range.HighlightColorIndex = wdYellow
               Selection.Collapse wdCollapseEnd
          Wend
End With
End Sub




