Disabling print in PowerPoint and Outlook

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

Disabling print in PowerPoint and Outlook
Ustun Ozgur

Posts: 8
Joined: 2017-12-30
For Word, we do the following to disable printing:

        private void adxExcelAppEvents1_WorkbookBeforePrint(object sender, ADXHostBeforeActionEventArgs e)
        { e.Cancel = true;}

However, for PowerPoint, the signature is different:

  private void adxPowerPointAppEvents1_PresentationPrint(object sender, object hostObj)
        { ... }

Is it possible to cancel a powerpoint event and if so how?

(Also, what is the sender and what is the hostobj in this case? I have searched the documentation, but couldn't find the relevant section.)

Similarly, for Outlook, we couldn't find the relevant event that handles the before print event. Could you provide some pointers in that regard as well?

Thank you in advance.
Posted 27 Jan, 2018 08:42:41 Top
Andrei Smolin

Add-in Express team

Posts: 14713
Joined: 2006-05-11
Hello Ustun,

That event is raised when PowerPoint raises this event: https://msdn.microsoft.com/en-us/VBA/PowerPoint-VBA/articles/application-presentationprint-event-powerpoint. As you can see, the host object is Presentation being pronted and there's no way to cancel the operation. A way out of this is to intercept clicking all controls that causes the presentation to get printed and cancel clicking these controls; you will need to hide the controls that PP shows on the BackstageView. Also, you will need to intercept pressing all key combinations that print the presentation.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Jan, 2018 05:01:37 Top

Posts: 8
Joined: 2017-12-30
Thank you very much Andrei. I'll try those solutions and let you know.

Posted 31 Jan, 2018 16:06:47 Top