msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Howto prevent Word doc to be printed in BW, allow it in Colo

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB WinAPI
Author Message
Radu



Joined: 14 Feb 2008
Posts: 1

PostPosted: Thu Feb 14, 2008 4:31 pm    Post subject: Howto prevent Word doc to be printed in BW, allow it in Colo Reply with quote

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.

Archived from group: microsoft>public>vb>winapi
Back to top
View user's profile Send private message
mike



Joined: 19 Jan 2008
Posts: 29

PostPosted: Fri Feb 15, 2008 5:28 am    Post subject: Re: Howto prevent Word doc to be printed in BW, allow it in Reply with quote

Radu wrote:
> 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.

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?

--
Return address is VALID!
Back to top
View user's profile Send private message
Howard Kaikow



Joined: 04 Oct 2007
Posts: 468

PostPosted: Fri Feb 15, 2008 4:01 pm    Post subject: Re: Howto prevent Word doc to be printed in BW, allow it in Reply with quote

"mike" wrote in message$th.772@trnddc05...

> 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.

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Issue with EnumJobs and number of printed copies in Word I'm using the EnumJobs WinAPI function to get the total number of pages printed to a printer. EnumJobs is populating a JOB_INFO_2 structure, and I'm getting the total pages printed in PagesPrinted * It works fine with all applications ex

List queued documents to be printed How do I get the list of documents about to be printed or still printing in my local printer? I am writing a program that needs to know whether the document that I printed (shell to another application) has been printed out already. Thank

How can I prevent my VB6-Form from getting the focus? Hi all, if there an API for that? I use a Form of my Application as an Container for a Tool-Window (this window is from another application), just as a "frame". If the Tool-Window is active and I use ALT-TAB then my "frame"-form get the focus. I want to p

How can I prevent my form from getting any smaller than a ce Hi Gang, I've created a form who's minimum workable size is really 640x 480 and I'd like to prevent users from resizing my application to any size beyond this point. Today for no apparent reason I stumbled across this command However,

How to prevent opening of a window? Hi, If a is started, I can, using hooks, for example, detect it and terminate it. However, you then see a momentary flash on the screen. Is there a message I can intercept and discard prior to launch? I assume part of Windows' OS is a progr
Post new topic   Reply to topic    msvisual.com Forum Index -> VB WinAPI All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group