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! |
|
Sergey Grischenko
Add-in Express team
Posts: 7235
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;
}
}
|
|