How to programmatically open an Outlook Shortcut

后端 未结 1 1537
长发绾君心
长发绾君心 2021-01-25 09:36

I\'m wondering if there is a way of programmatically opening an Outlook Shortcut from my addin.

I\'ve created the shortcut as follows

Sub AddShortcut()
          


        
相关标签:
1条回答
  • 2021-01-25 10:06

    If you want to trigger the Outlook integrated web browser, you should grab the OutlookBarShortcut.Target. If the Target is of type string, then use the following (substituting your Target for the address Text)...

    Office.CommandBarComboBox address = (Office.CommandBarComboBox)Application.ActiveExplorer().CommandBars.FindControl(26, 1740);
    address.Text = "http://www.stackoverflow.com";
    

    otherwise the type is Folder and you should assign Explorer.CurrentFolder. The only downside with this approach is that CommandBars have been deprecated with Outlook 2010 and this solution likely won't work in the next version of Office.

    Another alternative is to use Web Folder behavior as discussed in this SO post. You could create a hidden Folder used just for the purposes of navigation.

    0 讨论(0)
提交回复
热议问题