Re: Printer Object and Printer common dialog

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: YYZ (d)
Date: 11/11/04


Date: Thu, 11 Nov 2004 15:18:10 -0600


"Jeff Johnson [MVP: VB]" <i.get@enough.spam> wrote in message
news:OZubNYAyEHA.1188@tk2msftngp13.phx.gbl...
>
> "Brian K. Sheperd" <brians.remove@remove.lesker.com> wrote in message
> news:eeqxQRAyEHA.824@TK2MSFTNGP11.phx.gbl...
>
> > How can I use the printer object (not the common dialog) to print to a
> > particular printer? I tried to use printer.devicename, but I didnt have
> > any
> > luck. I can enumerate the printers using devicename, but that was about
> > it.
>
> For Each prt In Printers
> If prt.DeviceName = strDesiredDeviceName Then
> Set Printer = prt
> Exit For
> End If
> Next

When using Crystal reports, I found that more than this was necessary, at
least on NT type machines. I had to first find the current printer, store
that name in a string, set the NEW printer to the default printer, print,
then restore the default printer.

I used some code from VBnet to accomplish this. If anyone needs it I can
post it, but it's over 100 lines so I won't do it unless asked.

Matt



Relevant Pages

  • Re: Printer Object and Printer common dialog
    ... >> luck. ... I can enumerate the printers using devicename, ...
    (microsoft.public.vb.general.discussion)
  • Re: Printer Object and Printer common dialog
    ... > luck. ... I can enumerate the printers using devicename, ... For Each prt In Printers ...
    (microsoft.public.vb.general.discussion)
  • Re: Cheap Guitar screw up?
    ... Sheffield are selling Pacificas for £179, so you should get one for £150 ... plus your old guitar. ... Good luck, ... Cheers - didnt know they would do part exhcnages - to be fair mine is old, ...
    (alt.guitar.beginner)
  • RE: OT Please help
    ... I get the same thing i tried replacing some of the runtime files that didnt ... > no luck please help, Please note i am running 98 but had no luck on there ... > Outgoing mail is certified Virus Free. ...
    (microsoft.public.windowsxp.help_and_support)
  • RE: OT Please help
    ... I get the same thing i tried replacing some of the runtime files that didnt ... > no luck please help, Please note i am running 98 but had no luck on there ... > Outgoing mail is certified Virus Free. ...
    (microsoft.public.windowsxp.general)