begin process at 2008 07 05 14:32:42
1 205 204 membres
180 nouveaux aujourd'hui
14 119 membres club

Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum.
Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

Sujet : Common Dialog + ShowPrinter [ Divers / Débutants ] (zen69)

Common Dialog + ShowPrinter le 05/05/2008 16:50:04

zen69
Bonjour a tous,

J'ai presentement un problem avec le common dialog showprinter. Voila j'essaye de choisir l'imprimante sur laquelle je veux imprimer sans toute fois modifier l'imprimante par defaut. J'ai donc setter la propriété PrinterDefault = False. Cepandant je ne sais pas comment recupérer l'imprimante selectionnée dans le common dialog... Quelqu'un peut m'aider svp?




  zen69 aka Ortho Le Profett
  [site web]

Re : Common Dialog + ShowPrinter le 05/05/2008 17:33:03

zen69
Voici ce que j'ai jusqu'a maintenant:

Private Sub cmdPrint_Click()
    Dim qty As Integer, i As Integer
    Dim pFont As String
    Dim pFontSize As Single
    Dim pLines() As String
       
    On Error GoTo Err_Handler
   
    With adoTransfer
        .CommandType = adCmdText
        .RecordSource = "SELECT RTRIM(ITEMNMBR) AS ITEMNMBR, SUM(TRXQTY) AS TRXQTY FROM [MS-SERVER].M0851.dbo.IV10001 WHERE IVDOCNBR='TR" & txtTrNb.Text & "' GROUP BY RTRIM(ITEMNMBR) ORDER BY RTRIM(ITEMNMBR)"
        .Refresh
        With .Recordset
            If .RecordCount = 0 Then
                MsgBox "Transfert vide ou inexistant."
                Exit Sub
            End If
            If Not .EOF And Not .BOF Then
                .MoveFirst
            Else
                MsgBox "Transfert vide ou inexistant."
                Exit Sub
            End If
        End With
    End With

    txtPrint.Text = m0851 & vbCrLf & "Date : " & Format(Now, "yyyy-mm-dd") & vbCrLf & lineSep & vbCrLf
    With adoTransfer.Recordset
        Do While Not .EOF And Not .BOF
            DoEvents
            txtPrint.Text = txtPrint.Text & .Fields("ITEMNMBR").Value & String$(2, vbTab) & .Fields("TRXQTY").Value & vbCrLf
            qty = qty + .Fields("TRXQTY").Value
            .MoveNext
        Loop
    End With
    txtPrint.Text = txtPrint.Text & vbCrLf & lineSep & "Total : " & qty & " item(s)."
   
    comDiag.Flags = &H80000 + &H8 + &H4 + &H100000
    comDiag.PrinterDefault = False
    comDiag.ShowPrinter
       
    pLines = Split(txtPrint.Text, vbCrLf)
       
    With Printer
        .TrackDefault = False
       
        pFont = .font
        pFontSize = .fontSize
        .font = "ms sans serif"
        .fontSize = 10
        For i = LBound(pLines) To UBound(pLines)
            Printer.Print pLines(i)
        Next i
        '.EndDoc
        .font = pFont
        .fontSize = pFontSize
    End With
   
    Exit Sub
Err_Handler:
    MsgBox Err.Description, vbExclamation, Err.Number
    Exit Sub
End Sub





  zen69 aka Ortho Le Profett
  [site web]

Re : Common Dialog + ShowPrinter le 05/05/2008 20:02:08

zen69
Un peu d'aide serait grandement apprécié


  zen69 aka Ortho Le Profett
  [site web]

Re : Common Dialog + ShowPrinter le 06/05/2008 18:11:47

zen69
Réponse acceptée !
J'ai trouver:

.Flags = cdlPDReturnDC '&H100



  zen69 aka Ortho Le Profett
  [site web]


Classé sous : imprimante, dialog, showprinter, common

Participer à cet échange

Pub



Appels d'offres

Plugin Dialer outlook
Budget : 2 000€
Travail graphique- ill...
Budget : 1 000€
creation de marque et ...
Budget : 1 000€

Snippets en rapport

CalendriCode

Juillet 2008
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Téléchargements

Logiciels à télécharger sur le même thème :

Boutique

Boutique de goodies CodeS-SourceS