Default Printer / Reports (1 Viewer)

BWP

Registered User.
Local time
Today, 18:51
Joined
Jan 31, 2018
Messages
17
Hi All

Currently users can only access the "print" facility using shortcut menu (i've created on right-click) - oh and I guess using Ctrl+P. How /where do i call the function from to check whether default printer exists? Does Access check for default printer when using clicks to view report in acPreview (as this is the load format) - or only when they Ctrl+P or right-click/print?

I basically want to check for a default printer for the user when they login - so if one has been setup - do nothing otherwise warn user that they need to setup a default printer before attempting to print reports (or set the default printer to .pdf?)...

Help please!
 

BWP

Registered User.
Local time
Today, 18:51
Joined
Jan 31, 2018
Messages
17
Hi - thanks...

I think that will deal with first part question, but how do i then set the default printer to .pdf?

Code:
Dim prtDefault As Printer 

Set Application.Printer = Application.Printers(0) 

Set prtDefault = Application.Printer 

With prtDefault 
 MsgBox "Device name: " &; .DeviceName &; vbCr _ 
 &; "Driver name: " &; .DriverName &; vbCr _ 
 &; "Port: " &; .Port 
End With
 

Mark_

Longboard on the internet
Local time
Today, 11:51
Joined
Sep 12, 2017
Messages
2,111
If they don't have a default printer, they won't be able to print to PDF anyway. If they DO have a printer (including PDF) you will find that in the printers collection.
 

BWP

Registered User.
Local time
Today, 18:51
Joined
Jan 31, 2018
Messages
17
I don''t have a printer setup on my local pc and i can print to .pdf - so i am not quite sure that's correct Mark. Would you know how i can "reference" the .pdf printer?

Code:
If Application.Printer=false then
 Set Application.Printer(.pdf)
End If

?
 

Mark_

Longboard on the internet
Local time
Today, 11:51
Joined
Sep 12, 2017
Messages
2,111
Did you go through your printers collection to see what is in there for your machine?

Please remember, some programs will go through the printer dialog to use a .pdf print driver to "Print" to a PDF while others create PDFs as a saved format. If your computer goes through the printer dialog your .PDF driver should show up (iirc) as the first (or default) driver.
 

Mark_

Longboard on the internet
Local time
Today, 11:51
Joined
Sep 12, 2017
Messages
2,111
Try the attached on your machine and see what it reports. You will also want to do the same on some of the target machines to see if there is an issue with identifying which driver is the "Proper" driver for .PDF files.
 

Attachments

  • Printers.zip
    23.9 KB · Views: 77

Users who are viewing this thread

Top Bottom