Consulting

Results 1 to 1 of 1

Thread: SELECTION OF PRINTER AND PAPER SIZE IN COMBOBOX

  1. #1

    SELECTION OF PRINTER AND PAPER SIZE IN COMBOBOX

    Dear friends;

    I am trying to create an user form for automated printing. I need to insert two combobox objects in a form, one for select the printer and other one to select available paper size for the selected printer.

    I already achieve to get installed printers using this code:

    Dim nwo As New WshNetwork
        Dim i As Integer
       Dim j As Integer
        Dim bAdd As Boolean
    
        bAdd = True
        ImpresoraPlano.Clear
        For i = 0 To (nwo.EnumPrinterConnections.Count / 2) - 1
            For j = 0 To ImpresoraPlano.ListCount - 1
                If nwo.EnumPrinterConnections(i * 2 + 1) < ImpresoraPlano.List(j) Then
                    ImpresoraPlano.AddItem nwo.EnumPrinterConnections(i * 2 + 1), j
                    bAdd = False
                    Exit For
                End If
            Next j
            If bAdd Then ImpresoraPlano.AddItem nwo.EnumPrinterConnections(i * 2 + 1): bAdd = True
       Next i
    
    
        ImpresoraPlano.ListIndex = 2

    I can already fill the combobox with installed printers, but I am not being able to fill the second combobox with the available paper sizes for the selected printer. I have already look for solutions here and in other websites, but non code seem to works to me. I am not sure if I need to activate or add any library of object references.

    I definitely need help with this.

    Thanks in advance
    Last edited by Tommy; 06-04-2017 at 02:15 PM. Reason: Added Code Tags

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •