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
| Sub test()
IMPRESSION Feuil8
End Sub
Sub IMPRESSION(FeuilleAImprimer As Worksheet, Optional AvecDuplicata As Boolean = True)
Dim DuplicataShape As Shape
'On essai de pointer le shape duplicata
On Error Resume Next
Set DuplicataShape = FeuilleAImprimer.Shapes("WordArt 1")
On Error GoTo 0
'On empéche l'impression de la mention duplicata
If Not DuplicataShape Is Nothing Then DuplicataShape.ControlFormat.PrintObject = False
'On lance l'impression d'un exemplaire
FeuilleAImprimer.PrintOut Copies:=1
'On regarde si le second ex est demandé et si la mention duplicata existe
If AvecDuplicata And Not DuplicataShape Is Nothing Then
'On active l'impression du wordart
DuplicataShape.ControlFormat.PrintObject = True
'On lance l'impression
FeuilleAImprimer.PrintOut Copies:=1
End If
End Sub |
Partager