CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: printer

  1. #1
    Join Date
    Apr 1999
    Location
    Quebec, Canada
    Posts
    39

    printer

    on a button i need to be able to choose witch printer i need to print on. i have no idea the way to do it.
    thank you in advanced


  2. #2
    Join Date
    Dec 1999
    Location
    Malaysia
    Posts
    56

    Re: printer

    First, include the visual basic common dialog controls in your application (by pressing Ctrl-T). Place the common dialog control in your form. Now, include this code in your button's Command1_click() command.


    Sub Command1_Click()
    Commondialog1.ShowPrinter 'This brings up the print dialog box
    'which will give you a selection of printers
    'in your system.
    End Sub



    Hope that this helps...

    Cheers...


  3. #3
    Join Date
    Apr 1999
    Location
    Quebec, Canada
    Posts
    39

    Re: printer

    thanks a lot

    nath


  4. #4
    Join Date
    Sep 1999
    Location
    Germany
    Posts
    66

    Re: printer

    Also you can select a printer programatically from your VB application. Check follow sample:

    http://vbcode.webhostme.com/en/click.asp?id=80


    [email protected]
    http://vbcode.webhostme.com/

  5. #5
    Join Date
    Apr 1999
    Location
    Quebec, Canada
    Posts
    39

    Re: printer

    thank you for you're help

    but it doesn't work on a click button but i'm keeping the code for futur use and the adress

    nath



  6. #6
    Join Date
    Apr 1999
    Location
    Quebec, Canada
    Posts
    39

    Re: printer

    I wanted to thank you for the help andi found the code that worked for me so here it is if you ever need it




    Private Sub ImageImprimante_Click()
    On Error GoTo Err_ImageImprimante_Click

    DoCmd.DoMenuItem acFormBar, acrecordmenu, acSaveRecord, , acMenuVer70
    Dim stDocName As String, Critere As Variant

    Critere = Me![No_Appel]
    stDocName = "E_NoAppel"
    DoCmd.OpenReport stDocName, acViewPreview, [No_Appel], "[No_Appel] = " & Critere

    'This is the line that opens the file menu printer
    ' to be able to choose the printer

    DoCmd.DoMenuItem acFormBar, acFile, 6

    Exit_ImageImprimante_Click:
    Exit Sub

    Err_ImageImprimante_Click:
    MsgBox Err.Description
    Resume Exit_ImageImprimante_Click

    End Sub

    And Happy holydays
    nath


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured