Page count problem
VB.NET, Printing,
0.00 (0 votes)

Hi, I´m interested in the solution of word page count problem, for the PrintQueuewatch.



24-11-2017 22:08:08


Answers

Solution #1

5.00 (4 votes)

I have developed a software "printermonitor" using PrintQueuewatch dll. I also got a problem in page count for Microsoft word. To solve this error, I used to add registry key DWord "ForceSetCopyCount" for each version of Microsoft word and set value to 1. This trick will solve your problem permanently. See the below code:

private void addReg()
        {
            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();
                }
            }            

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

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

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

Hope this helps yes



Pallav Kumar
25-11-2017 14:17:21


Search