How to add toolbar button to contact item window in Outlook?
I am developing an add-in for Outlook. One requirement is to add a toolbar button to the contact item window. Can anyone tell me how 开发者_开发技巧to implement it? Thanks.
Depending on what Outlook versions you want to support you have to use two approaches.
On Outlook < 2007 you either add a new commandbar via myInspector.CommandBars.Add("my commandbar")
(MSDN) or use an existing one via e.g. myInspector.CommandBars.Item(1)
(MSDN).
Then add a button via myCommandBar.Controls.Add()
(MSDN).
On Outlook >= 2007 you need to customize the ribbon which is a bit more writing work. Customizing the Ribbon in Outlook 2007 is a good introduction into that.
精彩评论