Intercept Print

Add-in Express™ Support Service
That's what is more important than anything else

Intercept Print
 
Clay Borne




Posts: 1
Joined: 2013-05-16
Hello,
Getting started on an add-on that will intercept a print job from IE. Is this possible? What event do I need to look at? Thanks!
Posted 21 May, 2013 15:18:11 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi Clay,

To intercept the 'Page Setup', 'Print' and 'Print Preview' commands in IE you can use the 'OnBeforeExecute' event (see the code below). The 'HandleDocumentUICommands' property of the iemodule should be set to true.

        private const uint IE_PRINT = 6;
        private const uint IE_PRINT_PREVIEW = 7;
        private const uint IE_PAGE_SETUP = 8;

        private void IEModule_OnBeforeExecute(object sender, ADXIEBeforeExecuteEventArgs e)
        {
            if (e.CommandId == IE_PRINT || e.CommandId == IE_PRINT_PREVIEW || e.CommandId == IE_PAGE_SETUP)
            {
                e.Cancel = true;
            }
        }
Posted 22 May, 2013 04:52:09 Top