Bonjour,


J'ai trouvé ce code ici même mais j'ai un petit probleme et ne connaissant pas grand chose en VBA je me tourne vers vous. Voici mon problemem j'ai un document avec un sommaire et donc je souhaiterais imprimer la page dont le titre est "MODIFICATION DE PERIMETRE" mais pas le sommaire.

comment coder cela

merci de votre aide.

Bonne journée.


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
Sub ChercheEtPrint()
    ActiveDocument.Range.Select
    Selection.HomeKey Unit:=wdStory
    Selection.Range.Find.ClearFormatting
    With Selection.Find
        .Text = "MODIFICATION DE PERIMETRE"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindAsk
        .Format = False
        .MatchCase = False
        .MatchWholeWord = True 'Mots Entier
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        .Execute
    End With
  While Selection.Find.Found
       Debug.Print "Trouvé"
       Application.PrintOut Range:=wdPrintCurrentPage
       Selection.Find.Execute 'Cherche suivant
  Wend
  Call ChercheEtPrint2
  Call ChercheEtPrint3
End Sub