CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Location
    Quebec, Canada
    Posts
    39

    how to choose a printer with vb code

    I'm working with Access 2000 and the VB that comes with it. On a click button I need to be able to choose witch printer to print on (I've got two). how do I do it with the VB code, I really don't know how to do it and really need it

    thank you in advanced.


  2. #2
    Join Date
    Dec 1999
    Location
    Germany
    Posts
    26

    Re: how to choose a printer with vb code

    Hi,
    I don't know if this is the solution you are looking for, but it works with my Visual Basic 6 :

    Dim P as Printer
    for EACH P IN PRINTERS
    Combo1.AddItem P.DeviceName
    'Device Name returns a name for the printer, understandable in opposite to any driver information I have found so far
    next



    After the user has chosen, you need to set the selected printer as standart, referring to the Printers-Collection:

    set P = Printers (Combo1.ListIndex)



    Now you are basically done and can work with the properties of this printer.
    (At least in VB, I don't know about VBA...)


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

    Re: how to choose a printer with vb code

    Thank you for your help
    I will try it hope it will work but you know how VBA is fussy and VBA from Access2000 is even more

    thank you again
    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