[AccessD] Specific Printer

Paul Hartland paul.hartland at googlemail.com
Thu Feb 5 05:08:40 CST 2009


You may have a point, although we haven't had any problems with it, and it's
been on our main application for about 2 years now.

Paul

2009/2/5 Andy Lacey <andy at minstersystems.co.uk>

> Actually Paul, now I look at it this is changing the default printer before
> printing rather than setting a specific report to that printer. Not sure I
> want to do that. Isn't that fraught with the danger of a printing error
> leaving the user's default printer set wrong?
>
> Andy
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Paul Hartland
> Sent: 05 February 2009 10:25
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Specific Printer
>
>
> Andy,
>
> Just cut some sample code from what I use, you will need to know what the
> name of the printer is called on the network, but may get you started (this
> is VB6, but don't see why it wouldn't work for you):
>
>    Dim prnPrinter As Printer
>    Dim strDeviceName As String
>
>
>    strDeviceName = Printer.DeviceName
>    bolFoundPrinter = False
>    ' Loop through all printers to find specific one.
>    For Each prnPrinter In Printers
>        If (prnPrinter.DeviceName = "Network Zebra P110i USB Card Printer")
> Then
>     ' Set printer as default to print the report.
>            cSetPrinter.SetPrinterAsDefault ("Network Zebra P110i USB Card
> Printer")
>            'Print report here......
>            Exit For
>        End If
>    Next
>
>    ' Reset default printer to the original one.
>    For Each prnPrinter In Printers
>        If (prnPrinter.DeviceName = strDeviceName) Then
>            cSetPrinter.SetPrinterAsDefault (strDeviceName)
>            Exit For
>        End If
>    Next
>
> Had to negotiate the roads, I need to go freelance lol...
>
> 2009/2/5 Andy Lacey <andy at minstersystems.co.uk>
>
> > Hi folks
> > How do I supply an MDB with a report set to print to a specific
> > printer which I don't have? The report is used by several people in an
> > office and needs to print on their one colour printer which is not the
> > default for any of them. So it's a network printer and I'm not on
> > their netowrk of course. Can this be done, by code if necessary?
> >
> > Oh and this is A2K.
> >
> > Cheers
> >
> > Andy Lacey
> >
> > PS Deep snow today here. A very pretty English scene as long as you
> > don't have to try to negotiate the roads, which I don't tee hee.
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
>
>
>
> --
> Paul Hartland
> paul.hartland at googlemail.com
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



-- 
Paul Hartland
paul.hartland at googlemail.com



More information about the AccessD mailing list