If no default printer Open Print Diablog box
'This is exactly what I was looking for!
If Application.ActivePrinter = "" Then
Application.ActivePrinter = "Brother HL-1430 series on Ne02:
End if
End sub
'Thank you OssieMac
"--Gerard
"OssieMac" wrote in message
...
The following is untested because I don't know how you can have no default
printer if printers are actually connected to the computer. However, it
might
point you in the right direction.
You could use the following code to to find out what value (if any) is
returned if no default printer.
MsgBox Application.ActivePrinter
Then use code similar to the following where I have just assumed that if
no
default printer it will return a zero length string.
If Application.ActivePrinter = "" Then
Application.Dialogs(xlDialogPrint).Show
End If
Also you can use the following and simply set the required printer before
printing.
Application.ActivePrinter = "Brother HL-1430 series on Ne02:
Note that you need to properly identify the printer name with follwoing
code
when the printer has been set as the default printer for the computer.
MsgBox Application.ActivePrinter
--
Regards,
OssieMac
|