Printer Monitor Page Count with PrinterQueueWatch.dll

Pallav Kumar
11-01-2020 19:56:19
5.00 (1 votes)
Rate:

This blog is about solving the issue of page count problem of word file and excel file. In PrinterQueueWatch.dll, we always face page counting problem in word and excel files. So, I found the solution for this. You have to add one registry value ForceSetCopyCount and set value to 1 for both word and excel.

Here is the sample code for MS-Word

Microsoft.Win32.RegistryKey subKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Office\11.0\Word\Options");
            if (checkIfKeyExists(subKey))
            {
                RegistryKey keyx = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Office\11.0\Word\Options", true);
                {
                    keyx.SetValue("ForceSetCopyCount", 1, RegistryValueKind.DWord);
                    keyx.Flush();
                }
            }

Here is the sample code for MS-Excel

Microsoft.Win32.RegistryKey subKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Office\11.0\Excel\Options");
            if (checkIfKeyExists(subKey))
            {
                RegistryKey keyx = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Office\11.0\Excel\Options", true);
                {
                    keyx.SetValue("ForceSetCopyCount", 1, RegistryValueKind.DWord);
                    keyx.Flush();
                }
            }

Hope this help someone

Happy Coding yessmileyyes


Printing, C#, PrinterQueueWatch.dll



Sr. Software Engg. (India)
pallav.kumar837@gmail.com
8010265036








Search