Invoke 3rd party Outlook AddIn-Button from my AddIn

六眼飞鱼酱① 提交于 2019-12-04 05:52:11

问题


I'm looking to create an AddIn for outlook which will invoke an Attach and Forward function from another 3rd party addIn when a mail item is added to a certain folder, however I'm not sure how to find this button in order to invoke it. the desired button is displayed on the inbox screen (when mail is selected bottom left) but not when a mail is opened (double click) is in a drop-down, here's the structure. Highlighted is the desired function.

How would I invoke this function for a specific mail item I found the Redemption Library which seems useful but not sure how fully to apply it. Invoke Ribbon button in Outlook 2013

This is what I have so far. See comments. (snippet from @Dmitry Streblechenko)

private void ExecuteAttachAndForward()
    {
    Redemption.SafeInspector sInspector = new Redemption.SafeInspector();
    sInspector.Item = Application.ActiveInspector().CurrentItem;
    Redemption.SafeRibbon Ribbon = sInspector.Ribbon;
    string oldActiveTab = Ribbon.ActiveTab;
    Ribbon.ActiveTab = "Home";   // is this the correct name of the tab?         
    Redemption.SafeRibbonControl Control = Ribbon.Controls.Item("Attach and Forward"); 
    // how would I access the pdf sub function in the dropdown?
    Control.Execute();
    Ribbon.ActiveTab = oldActiveTab; //restore the active tab                          
}

回答1:


A hacky way: Invoke the Ribbon via Redemption and use SendKeys.SendWait("{DOWN}{ENTER}");

Actually this seems to work pretty well.



来源:https://stackoverflow.com/questions/31991107/invoke-3rd-party-outlook-addin-button-from-my-addin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!