none
Office Print Dialog Access RRS feed

  • Question

  • Hi all,

    is it possible to add some kind of eventlistener to the print dialog which will be initiated by the user in the regular office applications word, powerpoint, excel.

    In a nutshell:

    1. A user opens a word document with microsoft word 2010 and wants to print it.
    2. He presses the print button.
    3. The print dialog opens up.
    4. Eventlistener recognizes, that print dialog was opened -> get printer settings (paper, color, duplex, ...)
    5. User changes settings -> get printer settings (paper, color, duplex, ...)
    6. User prints document or closes dialog -> Recognize cancellation or print

    Is something like that possible? How could i achieve that?

    Thanks in advance.

    Best regards

    simon

    Thursday, November 15, 2012 1:59 PM

Answers

  • It's probably possible. I don't quite understand what you want to acheive beyond simply being notified that the print dialog is going up.

    It's a little different for each Office application. For Word, you probably want the Application level event "DocumentBeforePrint". If you are using Visual Studio Professional or higher, you have the option of using Visual Studio Tools For Office, and therefore the option of using a document level "BeforePrint" event. I'd probably only recommend the latter of these events if you're building a document level AddIn.

    It would be useful to know what language you want to use, and what type of project this is (AddIn, stand alone executable, etc).

    Once you have trapped the event, you can run code. If you want to display your own print dialog, or run code after the printing, I think you can do so by cancelling the print during the 'BeforePrint' handler, and initiating your own dialog. This shows how to use 'built in' dialog boxes (i.e. those used by Office). This is a list of Word dialog boxes available to you. This is someone using such a technique with Word.

    Sunday, November 18, 2012 5:26 PM