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


Guest


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: 18830
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.


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


Guest


Thank you very much Andrei. I'll try those solutions and let you know.

Best.
Posted 31 Jan, 2018 16:06:47 Top