Preview, print or email without printer installed

  • Thread starter Thread starter Silvester
  • Start date Start date
S

Silvester

I distribute an A2000 app. End users can preview, print or email reports in
access snapshot format.

In stray cases end users do not have printers installed on their machine.
For emailing I use the line

DoCmd.SendObject acSendReport, stDocName, "Snapshot Format"

In such cases I get error 2202, no printer installed even if I try to email
the report ...

Is there any workaround to this like maybe install a phantom printer using
the app setup in such cases ?

Thanks for any help.
 
You can install the printer driver for any printer that you need even if the
printer is not connected to the computer.

This will make Access happy.

I do it all the time for printers that my clients have but I don't.

Good luck.

Sco
 
Hi Silvester:

I agree wholeheartedly with Sco- actually Windows in general hates to not
have at least 1 default printer! I would probably include in your project's
Windows installer routine the capability of adding a printer object if none
exists... that would neutralize the problem from the getgo.

The only author that has tackeled this within the VBA environment has been
Ken Getz et al. I have 3 of his books that have mentioned how to handle API
printer events, which before Access 2002 were difficult to set up. The
change default printer code, though, is the briefest/easiest to work with.
It will involve code s.a.:

Sub SetDefaultPrinter()
Dim devs As Devices
Set devs = New Devices
Set devs.CurrentDevice = devs("HP LaserJet 5P")
Set devs = Nothing
End Sub

This should do it (together with the supporting modules mentioned in his
books)... Just go over and read his best book: "Access 2000 Developer's
Handbook Volume 1: Desktop Edition".

Regards,
Al
 
Hi Silvester:

I agree wholeheartedly with Sco- actually Windows in general hates to not
have at least 1 default printer! I would probably include in your project's
Windows installer routine the capability of adding a printer object if none
exists... that would neutralize the problem from the getgo.

The only author that has tackeled this within the VBA environment has been
Ken Getz et al. I have 3 of his books that have mentioned how to handle API
printer events, which before Access 2002 were difficult to set up. The
change default printer code, though, is the briefest/easiest to work with.
It will involve code s.a.:

Sub SetDefaultPrinter()
Dim devs As Devices
Set devs = New Devices
Set devs.CurrentDevice = devs("HP LaserJet 5P")
Set devs = Nothing
End Sub

This should do it (together with the supporting modules mentioned in his
books)... Just go over and read his best book: "Access 2000 Developer's
Handbook Volume 1: Desktop Edition".

Regards,
Al
 
Hi Silvester:

I agree wholeheartedly with Sco- actually Windows in general hates to not
have at least 1 default printer! I would probably include in your project's
Windows installer routine the capability of adding a printer object if none
exists... that would neutralize the problem from the getgo.

The only author that has tackeled this within the VBA environment has been
Ken Getz et al. I have 3 of his books that have mentioned how to handle API
printer events, which before Access 2002 were difficult to set up. The
change default printer code, though, is the briefest/easiest to work with.
It will involve code s.a.:

Sub SetDefaultPrinter()
Dim devs As Devices
Set devs = New Devices
Set devs.CurrentDevice = devs("HP LaserJet 5P")
Set devs = Nothing
End Sub

This should do it (together with the supporting modules mentioned in his
books)... Just go over and read his best book: "Access 2000 Developer's
Handbook Volume 1: Desktop Edition".

Regards,
Al
 
Back
Top