none
Detect when user presses "Update Folder" or "Send all" in the Send/Receive tab RRS feed

  • Question

  • Hi!

    I need to detect when the user presses "Update Folder" or "Send all" in the Send/Receive tab.

    I did not find any event for this using VSTO. I am only detecting when the user presses "Send/Receive All Folders" since this triggers the SyncObject.SyncStart event.

    I know I can do this using the IRibbonExtensibility interface and providing this XML:

    <customUI xmlns=""http://schemas.microsoft.com/office/2009/07/customui"" onLoad=""Ribbon_Load"" >
        <commands> 
        <command idMso=""UpdateFolder"" onAction=""MsoButtonClick_UpdateFolder"" />
        <command idMso=""SendAll"" onAction=""MsoButtonClick_SendAll"" />

    ...

    ...

    But in fact the problem of the above approach is that for example UpdateFolder can also be triggered by pressing Shift+F9 and if I press these keys the event is not triggered (it's like if the event from the Ribbon only works for the button press but not for the shortcuts).

    Thanks

    Tuesday, September 3, 2019 4:51 PM

All replies

  • Instead of using MsoButtonClick_SendAll in your ribbon XML, why not use your own click event handler and explicitly call Namespace.SendAndReceive()?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, September 3, 2019 9:28 PM
  • What do you mean by "my own event handler"?

    In fact SendAndReceive() is like the "Send and Receive all folders" while what I try to override are the "Update folder" and "Send All" buttons.

    Wednesday, September 4, 2019 11:28 AM
  • I meant specifying your own event handler for the button instead of the built-in one.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, September 4, 2019 2:08 PM
  • This only covers the button pressing, but not the Shift+F9 key press 
    Friday, September 6, 2019 1:19 PM
  • Of course. Why exactly are you trying to force a sync or detect a particular folder sync?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Friday, September 6, 2019 4:37 PM
  • Thanks... that's what I was thinking. 

    I had to intercept (API hooking) when Outlook detects when the Shift+F9 is pressed... :-(


    Friday, September 6, 2019 5:48 PM