You cannot associate the document file with a print job. At all. This is all in the hands of the app, which can do all kinds of weird things.
Printing subsystem in Windows knows nothing about the document files. It only knows on jobs, and the job name - though usually derived from the document file name - can be any.
Your best luck is to add hooks to all apps like Word and, for instance, disable the File/Print menu items or dialog boxes.
In mid-90ies there was a product called PC DOCS (now it is Hummingbird IIRC) which was a database to keep the documents. They applied hooks to lots of apps (from MS Office to Corel and Autocad) to replace the File/Open and File/Save As boxes to their database-related stuff. So, this is doable.
But the security will be weak anyway. How many email clients are there in the world? Lots of. So, the guy will just add the document as email attachment and send the email out. And so on. You can also, say, ZIP the sensitive documents and carry away the ZIP file. And so on.
As Tony said, Windows is not designed for this. In Windows, you can only limit whether the document is accessible for the user, but you cannot limit what kinds of access the user can do with it.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Developer
To: Windows System Software Devs Interest List
Sent: Thursday, November 03, 2005 8:13 PM
Subject: Re: [ntdev] Printer Warning Dialogbox
i respect all of you experts here, your opinion and experience is irreplaceable.
but…
there is also a factor called client demands, they just want us to try and give the best possible, these people know that “there is no lock in this universe that cannot be picked, no system that cannot be hacked and no man who cannot be broken”…but what matter is the time here, all we want to do is make the thieves life more difficult.
Okay, here is what I think of as a solution, experts and gurus, please beat this design black and blue (if you have time, and if you think it is even worth commenting on)…
We are implementing an FS filter driver to track the file while it is on the client side ( apart from API hooking and MSAA ). This filter can be used to communicate with the printer as well ( I don’t know about printer drivers at all, whether they can be filtered, etc. this is just a thought ), if it is a protected file, can’t we then block it’s printing, or any other thing we want, like signalling the admin, or the security department etc, writing a log, blah blah blah?
Please, I know there are other ways of bypassing security and getting the damn document out of office, after all what can I do if hte guy has a photographic memory 
Just tell me whether the design I gave stands a chance or not, and whether I acutally need to make the developers life this difficult jsut to achieve a small thing?
Thanks in advance,
Amitrajit
— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank email to xxxxx@lists.osr.com