none
"High" Reply Exposure RRS feed

  • Question

  • Hi to all

    I am trying to "trap something" that exposes the selection of the Reply "button" on the Home Ribbon. Explorer_SelectionChange is fired when this happens but it is also fired when the message is "opened - double clicked" (and many other things).  I tried to check for the "RE:" string in the newinspector event but it is not part of the subject line yet.  I need to be able to distinguish between the Ribbon Reply and the Opened Message Reply. The Opened Message Reply is easy for it is "trapped" by the mailitem_reply event - the Ribbon Reply is a much more elusive beast.  Another anomaly I am experiencing is I only have access to the inspectors_newinspector event; all of the other properties are missing from the intellisense under the visual basic IDE?

    Respectfully,

    Gordon Haas


    Gordon Haas

    Monday, November 19, 2012 3:28 PM

Answers

  • I have no idea about your Intellisense problem, but in NewInspector you get a weak object reference to the Inspector and its CurrentItem. Use that only to see what type of item it is and to subscribe to the Inspector.Activate() and possibly CurrentItem.Open(). In those events, especially Activate() you could determine what you want.
     
    You can also repurpose the ribbon controls using a <commands> </commands> section in your Explorer ribbon XML and handle the Click() event of any control you want. Not just the big Reply button but also context menu clicks on Reply. That would tell you if and when those buttons are clicked, you can then pass on the click to the native button handler. Do a search on "repurpose fluent ribbon controls" to get a bunch of links to articles about that.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "saahg" <=?utf-8?B?c2FhaGc=?=> wrote in message news:15456e68-a2a6-4ae3-b3d0-5b77091fbcff...

    Hi to all

    I am trying to "trap something" that exposes the selection of the Reply "button" on the Home Ribbon. Explorer_SelectionChange is fired when this happens but it is also fired when the message is "opened - double clicked" (and many other things).  I tried to check for the "RE:" string in the newinspector event but it is not part of the subject line yet.  I need to be able to distinguish between the Ribbon Reply and the Opened Message Reply. The Opened Message Reply is easy for it is "trapped" by the mailitem_reply event - the Ribbon Reply is a much more elusive beast.  Another anomaly I am experiencing is I only have access to the inspectors_newinspector event; all of the other properties are missing from the intellisense under the visual basic IDE?

    Respectfully,

    Gordon Haas


    Gordon Haas


    Ken Slovak MVP - Outlook
    Monday, November 19, 2012 4:05 PM
    Moderator
  • Yeah, this isn't easy.  I think the best approach is to take what you are doing with trapping the MailItem.Reply event - except you have to manage a collection of MailItem objects that include not only open messages but those that are selected by using SelectionChange.  There's also the nasty problem of being able to right-click a message that is NOT selected and replying to it.  In that case you have to trap Ribbon callbacks for that button - I believe there is a property at that point that you can use to get a reference to the item that was right-clicked, but I can't remember what it is.  However, I think this fails with CommandBar based context menus (Outlook 2007 and earlier), but I know it's possible if you use Add-in Express for creating Ribbons and toolbars.

    Eric Legault MVP (Outlook)
    About me...
    Try Outlook Appins - affordable and easy to use!

    Monday, November 19, 2012 4:08 PM
    Moderator

All replies

  • I have no idea about your Intellisense problem, but in NewInspector you get a weak object reference to the Inspector and its CurrentItem. Use that only to see what type of item it is and to subscribe to the Inspector.Activate() and possibly CurrentItem.Open(). In those events, especially Activate() you could determine what you want.
     
    You can also repurpose the ribbon controls using a <commands> </commands> section in your Explorer ribbon XML and handle the Click() event of any control you want. Not just the big Reply button but also context menu clicks on Reply. That would tell you if and when those buttons are clicked, you can then pass on the click to the native button handler. Do a search on "repurpose fluent ribbon controls" to get a bunch of links to articles about that.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "saahg" <=?utf-8?B?c2FhaGc=?=> wrote in message news:15456e68-a2a6-4ae3-b3d0-5b77091fbcff...

    Hi to all

    I am trying to "trap something" that exposes the selection of the Reply "button" on the Home Ribbon. Explorer_SelectionChange is fired when this happens but it is also fired when the message is "opened - double clicked" (and many other things).  I tried to check for the "RE:" string in the newinspector event but it is not part of the subject line yet.  I need to be able to distinguish between the Ribbon Reply and the Opened Message Reply. The Opened Message Reply is easy for it is "trapped" by the mailitem_reply event - the Ribbon Reply is a much more elusive beast.  Another anomaly I am experiencing is I only have access to the inspectors_newinspector event; all of the other properties are missing from the intellisense under the visual basic IDE?

    Respectfully,

    Gordon Haas


    Gordon Haas


    Ken Slovak MVP - Outlook
    Monday, November 19, 2012 4:05 PM
    Moderator
  • Yeah, this isn't easy.  I think the best approach is to take what you are doing with trapping the MailItem.Reply event - except you have to manage a collection of MailItem objects that include not only open messages but those that are selected by using SelectionChange.  There's also the nasty problem of being able to right-click a message that is NOT selected and replying to it.  In that case you have to trap Ribbon callbacks for that button - I believe there is a property at that point that you can use to get a reference to the item that was right-clicked, but I can't remember what it is.  However, I think this fails with CommandBar based context menus (Outlook 2007 and earlier), but I know it's possible if you use Add-in Express for creating Ribbons and toolbars.

    Eric Legault MVP (Outlook)
    About me...
    Try Outlook Appins - affordable and easy to use!

    Monday, November 19, 2012 4:08 PM
    Moderator