Bonjour ,
j'ai trouver comment oubliger access a prendre une imprimante specifique en code vba.
Mais mon soucis c'est quand je la lance mon impression et si mon imprimante
n'existe pas il me le balance sur une autre imprimante,
comment rajouter un message qui dit "imprimante non connecte" et arrete l'impression.
Voici mon code vba :
si vous avez des ameliorations sur ce code je suis preneur
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 Private Sub Commande146_Click() On Error GoTo Err_Commande146_Click Dim NombreImp As Integer Dim ImpCherche NombreImp = Application.Printers.Count For Each ImpCherche In Application.Printers If ImpCherche.DeviceName = "Epson stylus d78 series" Then Set Application.Printer = Application.Printers(NumIMP) Exit For End If Next ImpCherche Dim stDocName As String stDocName = "ET-Etiquette prix" DoCmd.OpenReport stDocName, acNormal Exit_Commande146_Click: Exit Sub Err_Commande146_Click: MsgBox Err.Description Resume Exit_Commande146_Click End Sub
Partager