Quantcast
Channel: Word for Developers forum
Viewing all articles
Browse latest Browse all 4350

Wrong dmCopies member value when triyng to get print job info from DEVMODE after printintg from Word (2003,2007,2010)

$
0
0

We are developing program that monitors print jobs in the Windows system. Notification about print job are received by FindFirstPrinterChangeNotification and FindNextPrinterChangeNotification functions. With FindNextPrinterChangeNotification I'm getting DEVMODE structure (by JOB_NOTIFY_FIELD_DEVMODE parameter). I get wrong dmCopies member value when testing application with Microsoft Word. At first Word was returning only value "1". This is fixed by adding "ForceSetCopyCount" value in the registry (more information herehttp://support.microsoft.com/kb/919736/en-us). After that dmCopies started to show correct copy counts.

But this fix has one bug. I get incorrect results if I print documents in same Word (do not turn off Word application):

In first print job i print 1 copy, second time 2 copies, third time again 1 copy.

In my application i get this info from DEVMODE:

first job copy count = 1, second job copy count = 2, third job copie count = 2.  So, I get last max copie count if I try to set copy to 1.

This applies only for Microsoft Word. Excel, PowerPoint works OK. 

After closing and opening Word application I get correct copy count value for first document. So it seems that Word forgets to reset copy count for 1. This bug appears only if I set copy count from higher to 1, but if I set it from 5 to 3 I'm getting 5 and 3 in dmCopies.

Anyone encountered this problem before?

 

 





Viewing all articles
Browse latest Browse all 4350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>