Salut j'ai les codes ci-dessous qui fonctionne déjà parfaitement. Ce que je ne peux pas comprendre, c'est comment compter le nombre de fois qu'une recherche générique trouve une correspondance. Quelqu'un peut-il me dire comment je peux y arriver? Les codes sont les suivants:WORD VBA Count Hits de recherche génériques
Sub findfunction()
If (findHL(activedocument.Content, "[aeiou]")) = True Then MsgBox "Highlight vowels Done", vbInformation + vbOKOnly, "Vowels Highlight Result"
If (findHL(activedocument.Range, "<wa*>")) = True Then MsgBox "Highlight words beginning with WA", vbInformation + vbOKOnly, "Prefix Find Result"
End Sub
Function findHL(r As Range, s As String) As Boolean
Options.DefaultHighlightColorIndex = wdRed
r.Find.Replacement.highlight = True
r.Find.Execute FindText:=s, MatchWildcards:=True, Wrap:=wdFindContinue, Format:=True, replace:=wdReplaceAll
findHL = True
End Function
Toute aide serait grandement appréciée. Merci les gars!