Bonjour,
Je souhaite rechercher des mots dans l'ensemble de mon document Word. Dans cet exemple, je recherche le mot "maison".
Cela semble fonctionner, mais pas pour les tableaux. L'ensemble du texte des tableaux est modifié en bleu (
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 Sub Legal() Dim para As Paragraph Dim wrd Dim i As Integer For Each para In ActiveDocument.Paragraphs para.Range.Select i = 1 a = Selection.Words.Count For i = 1 To a With Selection.Find .ClearFormatting .Text = "maison" .Format = False .Forward = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute 'Debug.Print .Found End With Selection.Font.Color = wdColorBlue Next i Next para End Sub
Merci d'avance,
Antoine
Partager