visual basic question

Open discussion about any topic, as long as you abide by the rules of course!
Post Reply
Tsakali
Posts: 7175
Joined: Thu Mar 02, 2000 8:00 am

visual basic question

Post by Tsakali »

I'm looking to simply have a button that browses for a printer, or browses only the printers... I can't find any help on this.

My program requires for a user to be able to choose a printer, or more specificaly the user needs to specify the printer location/address, and I figured a browser would be helpful, if not expected in this day and age
R00k
Posts: 15188
Joined: Mon Dec 18, 2000 8:00 am

Post by R00k »

I've hunted down a ton of VB stuff for printers at work. If you haven't gotten anything by then, I'll post some links up tomorrow.
Tsakali
Posts: 7175
Joined: Thu Mar 02, 2000 8:00 am

Post by Tsakali »

thanx for helping a rookie out :icon30:
Tsakali
Posts: 7175
Joined: Thu Mar 02, 2000 8:00 am

Post by Tsakali »

good day rook :icon25:
Cool Blue
Posts: 916
Joined: Wed Mar 02, 2005 2:39 am

Post by Cool Blue »

You would have to write your own 'browser' to do that. May I ask what's wrong with using the default printer?

If the user already has the printers installed (drivers), using a simple printpreviewdialog() object will allow them to select which printer they want to print to.
Cool Blue
Posts: 916
Joined: Wed Mar 02, 2005 2:39 am

Post by Cool Blue »

Tsakali
Posts: 7175
Joined: Thu Mar 02, 2000 8:00 am

Post by Tsakali »

that website is a nightmare to browse. Thanx anyway.
bitWISE
Posts: 10704
Joined: Wed Dec 08, 1999 8:00 am

Post by bitWISE »

Cool Blue wrote:If the user already has the printers installed (drivers), using a simple printpreviewdialog() object will allow them to select which printer they want to print to.
That's what I was going to say. The print dialog is so common there had to be a built in control you could add.
Denz
Posts: 2587
Joined: Thu Aug 17, 2000 7:00 am

Post by Denz »

Code: Select all

    Dim frm As New frmPreview

    Dim CD As mscomdlg.CommonDialog
    Set CD = frmPreview.CommonDialog1

    CD.CancelError = True
    On Error Resume Next

    CD.ShowPrinter

    If Err.Number = 32755 Then Exit Function

    On Error GoTo 0

        Printer.Orientation = cdlLandscape

    If preview Then
        Set PRN = frmPreview
    Else
        Set PRN = Printer
        If PRN Is Nothing Then
            Exit Function
        End If
    End If

You will probably need to ICQ me if you have any problems with this, I have this on one of the programs that I created.

I can give you more if you need it. It works great here.

150284426
Post Reply