VBA调用Outlook2010 Ribbon上按钮的命令

Sub ExecuteRibbonButton()
    Dim Item As Outlook.MailItem
    
    Set Item = Application.ActiveExplorer().Selection(1)
    Item.GetInspector.Display
    Item.GetInspector.CommandBars.ExecuteMso ("MoveToOneNote")
    
    Set Item = Nothing
End Sub

由于MoveToOneNote是MailReadInspector上的按钮,所以必须激活Inspector才能执行这个命令。

相关下载:http://download.csdn.net/detail/tx_officedev/4106151

你可能感兴趣的:(VBA)