I would have thought that such an experienced coder would have been able to
arrange something suitable and saved me the bother, but the following macro
in the document template (or at a pinch in the document itself - though that
raises the spectre of macro security) will do the job. The macro intercepts
the print button and looks for the string "COLOR" in the available printers
(converting to printer names to upper case) . You can change that string to
match the printer you require for the document.
Sub FilePrintDefault()
Dim StrPrinters As Variant, i As Long
Dim sPrinter As String
Dim sNone As String
StrPrinters = ListPrinters
sPrinter = ActivePrinter
If IsBounded(StrPrinters) Then
For i = LBound(StrPrinters) To UBound(StrPrinters)
If InStr(UCase(StrPrinters(i)), "COLOR") Then
ActivePrinter = StrPrinters(i)
GoTo PrintDoc
End If
Next i
sNone = MsgBox("Required printer not available" & vbCr & vbCr & _
"Print to default Word printer?", vbYesNo, "Printer
Error")
If sNone <> vbYes Then
MsgBox "Print cancelled"
ActivePrinter = sPrinter
Exit Sub
Else
GoTo PrintDoc
End If
Else
MsgBox "No printers found"
End If
Exit Sub
PrintDoc:
MsgBox "Printing to " & ActivePrinter
ActiveDocument.PrintOut
ActivePrinter = sPrinter
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>