Hi. I've been given the following task
Some of our "precious" docs will be saved in a shared folder on the
network. Only some people will have access to that folder. Those
people are supposed to print those docs, BUT ONLY IN COLOR - BW
printing should pe prevented. So... this is my problem.
Up to now (this morning) I have come up with some VB code to enumerate
through all attached (local and networked) printers and determine
(with DeviceCapabilities, DC_COLORDEVICE) their print capabilities.
Also, I have written in the documents themselves some VBA code which
in the event "DocumentBeforePrint" could check the above-mentioned
capabilities (right now it only asks "are you sure blah blah blah?").
Since I create these docs by code, I could easily add this VBA code
through extensibility (which, BTW, also creates the problem of users
disallowing word from running macros, and thus obtaining access to BW
printing....)
My problem is that the dialog of the printer driver (i.e. the printer
selection, the printer's proprieties, etc) is shown AFTER the
DocumentBeforePrint event, so therefore in DocumentBeforePrint I
cannot check
a. The selected printer
b. The selected printer's color caps
c. The selection in the printer's driver directly (the user might use
a color printer to print in BW, by clicking on the printers's
proprieties, then on the "Quality" tab, or whatever the tab for color/
BW selection might be for that specific printer).
So in other words the only thing I can do right now is to prevent
printing if NO visible printer has color caps. In all other situations
(another printer selected, changing of printer's print proprieties (by
the user), macros not allowed to run in the Word document, etc) I
cannot do a thing.
Is there a way I could do this ?
Thanks a lot, Alex.
mike - 15 Feb 2008 00:28 GMT
> Hi. I've been given the following task
>
[quoted text clipped - 36 lines]
>
> Thanks a lot, Alex.
I'm REALLY curious as to why.
Can you make the documents UNPRINTABLE?
Then have a separate program that prints them to
specified printers only?

Signature
Return address is VALID!
Howard Kaikow - 15 Feb 2008 16:01 GMT
> I'm REALLY curious as to why.
>
> Can you make the documents UNPRINTABLE?
> Then have a separate program that prints them to
> specified printers only?
The real question is "Why distribute/make available a Word doc, unless there
is a need to allow others to edit the doc?".
Word is a horrible format to use for docs to be printed, that's what PDF is
for, and you can make a PDF document unprintable.
As to restricting which printer a doc can be printed on, that could be done
by using code that intercepts the action within Word and then selects the
printer. But such restrictions can be overcome, e.g., by attaching a
different Word template file, or by moving the file to another computer
where Word has no such restrictions.