Log in

View Full Version : VBA and printing



francozola25
08-10-2008, 09:56 AM
Hello i have a problem with printing

I currently have 4 users that will automatically print documents single sided in vba. I have 1 main user and 3 back up users when that person is not around.

currently for my main user they are connected to a printer call formsprinter which has a settings that it will print single sided.


ActivePrinter = "formsprinter"
bDoc.PrintOut


My problem is that my other 3 users will not be able to connect to this printer as formsprinter is a local printer for the main user.

I want to then say
if formsprinter exists then
ActivePrinter = "formsprinter"
bDoc.PrintOut
else
bDoc.PrintOut

I will have to tell my other three users to make sure they have the option set to single-sided before printing off. Is there are easier way or could someone help me with the syntax on formsprinter?

mdmackillop
08-10-2008, 01:01 PM
Sub Prints()
On Error Resume Next
ActivePrinter = "formsprinter"
bDoc.PrintOut
End Sub

francozola25
08-11-2008, 01:10 AM
Thanks for that guys

Worked brillantly