A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

*** H E L P ***** - Printing to specific Printer Driver



 
 
Thread Tools Display Modes
  #1  
Old May 1st, 2008, 07:56 PM posted to microsoft.public.access.gettingstarted,microsoft.public.access.macros,microsoft.public.access.modulescoding,microsoft.public.access.queries,microsoft.public.access.reports
Jasmine
external usenet poster
 
Posts: 8
Default *** 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  
Old May 2nd, 2008, 02:59 AM posted to microsoft.public.access.gettingstarted,microsoft.public.access.macros,microsoft.public.access.modulescoding,microsoft.public.access.queries,microsoft.public.access.reports
Stuart McCall
external usenet poster
 
Posts: 41
Default *** 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  
Old May 2nd, 2008, 01:53 PM posted to microsoft.public.access.gettingstarted,microsoft.public.access.macros,microsoft.public.access.modulescoding,microsoft.public.access.queries,microsoft.public.access.reports
Stuart McCall
external usenet poster
 
Posts: 41
Default *** 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  
Old May 2nd, 2008, 02:26 PM posted to microsoft.public.access.gettingstarted,microsoft.public.access.macros,microsoft.public.access.modulescoding,microsoft.public.access.queries,microsoft.public.access.reports
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default *** 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  
Old May 2nd, 2008, 09:19 PM posted to microsoft.public.access.gettingstarted,microsoft.public.access.macros,microsoft.public.access.modulescoding,microsoft.public.access.queries,microsoft.public.access.reports
Stuart McCall
external usenet poster
 
Posts: 41
Default *** 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  
Old May 3rd, 2008, 06:20 PM posted to microsoft.public.access.gettingstarted,microsoft.public.access.macros,microsoft.public.access.queries,microsoft.public.access.reports
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default *** 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  
Old May 5th, 2008, 04:15 PM posted to microsoft.public.access.gettingstarted,microsoft.public.access.macros,microsoft.public.access.modulescoding,microsoft.public.access.queries,microsoft.public.access.reports
Jasmine
external usenet poster
 
Posts: 8
Default *** 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.