Bonjour,

Alors voici mon code qui permet de générer des documents pdf via une imprimante virtuelle
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 Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
 
        Dim changePrinterDefaut As String = "PDFCreator"
        'ne pas voir pdf creato ou autre
 
        Dim OkPrint As Boolean
        Dim PDS As Printing.PrinterSettings = New Printing.PrinterSettings
 
        For Each strPrinter As String In Printing.PrinterSettings.InstalledPrinters
            'si PDF Creator est installe chez l'user
            'affecter à pds
            If strPrinter = changePrinterDefaut Then
                OkPrint = True
                PDS.PrinterName = strPrinter
 
 
                Exit For
            End If
        Next
        'installe =>affecter à imprimante à PrintDocument1
        If OkPrint Then
            Me.PrintDocument1.PrinterSettings.PrinterName = PDS.PrinterName
        Else
            MessageBox.Show("l'impression necessite l'installation de " & changePrinterDefaut)
            Return
        End If
        ' Lancer l'impression 
        Me.PrintDocument1.Print()
        MessageBox.Show("Impressions effectuée")

En fait je voudrais que l'utilisateur puisse enregistrer ses document en écrivant le chemin de destination dans sa TextBox, est ce possible?

Merci,