Extend printdialog

Posted on 2009-02-13
Last Modified: 2012-05-06
Hi all,

I need to extend the printdialog in Windows (XP/Vista). I need to add a (hyperlink)button to it and be able to react to the click event for that button and interact with the 'normal' printdialog.
I prefer to create some kind of systemwide hook and capture all printdialogs for Windows but if this is not possible then I want to create this for Office 2007 (Word, Excel, Outlook...).

On MSDN I have found some articles but I need some C# sample code for this. Can anybody provide this?


Question by:roverm
    LVL 26

    Accepted Solution

    LVL 12

    Author Comment

    Hi, thanks but these are not sufficient (I already knew these).
    This example only alters the printdialog that is created from my own application. This is not what I want to do.
    LVL 12

    Expert Comment

    So what you want to do is drop a hyperlink into *every* print dialog that can popup in the system?

     These Print dialogs may be customized, where are thinking of putting the hyperlink? You are looking at a huge rat hole..abandon hope for there be tigars.

     If you can tell us why you want to do this there may be a better solution.

    LVL 12

    Author Comment

    Hi William,
    The basic idea was to add a button to the printdialog of Word, then Excel, then Outlook.... and so on. I am a dotnet devver so using managed code I should be able to "easily" do this using C# for Office2007.
    However, what about other applications (like notepad)?

    Like I said in the opening post, I prefer to do it systemwide but if not possible then start with Word 2007.

    The code that is executed behind 'my button' is not important, it could be anything.
    LVL 12

    Author Comment

    btw: The code sample "PrintOddEven" on CodeProject might be usable if I could intercept the Word print command. Is there a way to do this? Maybe by creating an AddIn for Word2007?
    LVL 12

    Author Closing Comment

    Closing this question. I didn't solve the problem (yet) using C#. Using C++ it's possible to set a systemwide hook to capture every printdialog.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
    Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
    Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
    This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now