If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
*** H E L P ***** - Printing to specific Printer Driver
I want to print a form and its contents ,
In the past i've use Docmd.Printout to send the form to the printer this has worked well in the past. Now I want to sent the printout to a specific Printer Driver in my Printers Drivers Selection. Preferrably would like to choose which printer driver I want. One of these drivers are a Print Capture with specific routing capabilities |
#2
|
|||
|
|||
*** H E L P ***** - Printing to specific Printer Driver
"Jasmine" news.microsoft.com wrote in message
... I want to print a form and its contents , In the past i've use Docmd.Printout to send the form to the printer this has worked well in the past. Now I want to sent the printout to a specific Printer Driver in my Printers Drivers Selection. Preferrably would like to choose which printer driver I want. One of these drivers are a Print Capture with specific routing capabilities The way I deal with this is: 1. Set the Report to print to the Windows default printer (File | Page Setup | Page | Default Printer. 2. Provide the user with a listbox from which to choose a printer. This little function will return a semicolon-delimited list of printers for use as a listbox's RowSource (RowSourceDataType must be 'Value List') Public Function PrinterList() As String Dim pr As Access.Printer ' For Each pr In Application.Printers r$ = r$ & ";" & pr.DeviceName Next If r$ "" Then PrinterList = Mid$(r$, 2) End If End Function 3. Save the current setting of the 'Windows Default Printer', change it to the printer selected by the user, then run the report, and finally return the default to the saved string. The code I use for this is: Public Sub SetDevice(ByVal pDevice As String) Static SavedPrinter As String ' With Application If Len(pDevice) Then SavedPrinter = .Printer.DeviceName Set .Printer = .Printers(pDevice) Else Set .Printer = .Printers(SavedPrinter) SavedPrinter = "" End If End With End Sub which is intended to be used like this: SetDevice "The selected printer name" DoCmd.Printout ... SetDevice "" |
#3
|
|||
|
|||
*** H E L P ***** - Printing to specific Printer Driver
"Jeff Boyce" -DISCARD_HYPHEN_TO_END wrote in message ... Stuart That sounds like a feasible work-around for the Access 2007 "print-to-specific-printer" issue! Do you know if this works for Access 2007? Thanks! -- Regards Jeff Boyce www.InformationFutures.net Microsoft Office/Access MVP http://mvp.support.microsoft.com/ Microsoft IT Academy Program Mentor http://microsoftitacademy.com/ "Stuart McCall" wrote in message ... "Jasmine" news.microsoft.com wrote in message ... I want to print a form and its contents , In the past i've use Docmd.Printout to send the form to the printer this has worked well in the past. Now I want to sent the printout to a specific Printer Driver in my Printers Drivers Selection. Preferrably would like to choose which printer driver I want. One of these drivers are a Print Capture with specific routing capabilities The way I deal with this is: 1. Set the Report to print to the Windows default printer (File | Page Setup | Page | Default Printer. 2. Provide the user with a listbox from which to choose a printer. This little function will return a semicolon-delimited list of printers for use as a listbox's RowSource (RowSourceDataType must be 'Value List') Public Function PrinterList() As String Dim pr As Access.Printer ' For Each pr In Application.Printers r$ = r$ & ";" & pr.DeviceName Next If r$ "" Then PrinterList = Mid$(r$, 2) End If End Function 3. Save the current setting of the 'Windows Default Printer', change it to the printer selected by the user, then run the report, and finally return the default to the saved string. The code I use for this is: Public Sub SetDevice(ByVal pDevice As String) Static SavedPrinter As String ' With Application If Len(pDevice) Then SavedPrinter = .Printer.DeviceName Set .Printer = .Printers(pDevice) Else Set .Printer = .Printers(SavedPrinter) SavedPrinter = "" End If End With End Sub which is intended to be used like this: SetDevice "The selected printer name" DoCmd.Printout ... SetDevice "" Hi Jeff It certainly looks like it. There's a default printer option in A2007. Report Design Ribbon-Page Setup-Page Setup-Page-Default/Use Specific Unfortunately I haven't time to test right now. Maybe this evening if I return in time. |
#4
|
|||
|
|||
*** H E L P ***** - Printing to specific Printer Driver
Stuart
That sounds like a feasible work-around for the Access 2007 "print-to-specific-printer" issue! Do you know if this works for Access 2007? Thanks! -- Regards Jeff Boyce www.InformationFutures.net Microsoft Office/Access MVP http://mvp.support.microsoft.com/ Microsoft IT Academy Program Mentor http://microsoftitacademy.com/ "Stuart McCall" wrote in message ... "Jasmine" news.microsoft.com wrote in message ... I want to print a form and its contents , In the past i've use Docmd.Printout to send the form to the printer this has worked well in the past. Now I want to sent the printout to a specific Printer Driver in my Printers Drivers Selection. Preferrably would like to choose which printer driver I want. One of these drivers are a Print Capture with specific routing capabilities The way I deal with this is: 1. Set the Report to print to the Windows default printer (File | Page Setup | Page | Default Printer. 2. Provide the user with a listbox from which to choose a printer. This little function will return a semicolon-delimited list of printers for use as a listbox's RowSource (RowSourceDataType must be 'Value List') Public Function PrinterList() As String Dim pr As Access.Printer ' For Each pr In Application.Printers r$ = r$ & ";" & pr.DeviceName Next If r$ "" Then PrinterList = Mid$(r$, 2) End If End Function 3. Save the current setting of the 'Windows Default Printer', change it to the printer selected by the user, then run the report, and finally return the default to the saved string. The code I use for this is: Public Sub SetDevice(ByVal pDevice As String) Static SavedPrinter As String ' With Application If Len(pDevice) Then SavedPrinter = .Printer.DeviceName Set .Printer = .Printers(pDevice) Else Set .Printer = .Printers(SavedPrinter) SavedPrinter = "" End If End With End Sub which is intended to be used like this: SetDevice "The selected printer name" DoCmd.Printout ... SetDevice "" |
#5
|
|||
|
|||
*** H E L P ***** - Printing to specific Printer Driver
"Jeff Boyce" -DISCARD_HYPHEN_TO_END wrote in message
... Stuart That sounds like a feasible work-around for the Access 2007 "print-to-specific-printer" issue! Do you know if this works for Access 2007? Thanks! -- Regards Jeff Boyce www.InformationFutures.net SNIP Hi Jeff I just ran a test in A2007 and it does indeed work, just like previous versions. All the ceveloper has to do is open the report in design view, get to the page setup dialog and check the option 'Print to default printer', then use my code to surround any DoCmd.OpenReport or DoCmd.PrintOut calls. |
#6
|
|||
|
|||
*** H E L P ***** - Printing to specific Printer Driver
Stuart:
Good to see that the Lancashire Rottweiler's hasn't lost his bite. As you can see the Staffordshire Bull Terrier's still just about capable of gnawing in a soggy piece of Winalot. If you have a moment drop me line to let me know how things are going. kenwsheridanatyahoodotcodotuk Ken Sheridan Stafford, England |
#7
|
|||
|
|||
*** H E L P ***** - Printing to specific Printer Driver
Thank you all for your help.
All recommendations were helpful. "Stuart McCall" wrote in message ... "Jasmine" news.microsoft.com wrote in message ... I want to print a form and its contents , In the past i've use Docmd.Printout to send the form to the printer this has worked well in the past. Now I want to sent the printout to a specific Printer Driver in my Printers Drivers Selection. Preferrably would like to choose which printer driver I want. One of these drivers are a Print Capture with specific routing capabilities The way I deal with this is: 1. Set the Report to print to the Windows default printer (File | Page Setup | Page | Default Printer. 2. Provide the user with a listbox from which to choose a printer. This little function will return a semicolon-delimited list of printers for use as a listbox's RowSource (RowSourceDataType must be 'Value List') Public Function PrinterList() As String Dim pr As Access.Printer ' For Each pr In Application.Printers r$ = r$ & ";" & pr.DeviceName Next If r$ "" Then PrinterList = Mid$(r$, 2) End If End Function 3. Save the current setting of the 'Windows Default Printer', change it to the printer selected by the user, then run the report, and finally return the default to the saved string. The code I use for this is: Public Sub SetDevice(ByVal pDevice As String) Static SavedPrinter As String ' With Application If Len(pDevice) Then SavedPrinter = .Printer.DeviceName Set .Printer = .Printers(pDevice) Else Set .Printer = .Printers(SavedPrinter) SavedPrinter = "" End If End With End Sub which is intended to be used like this: SetDevice "The selected printer name" DoCmd.Printout ... SetDevice "" |
Thread Tools | |
Display Modes | |
|
|