Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

Refresh Outlook 2003 Commandbar Menu subitems

I have an VSTO project directed at Outlook 2003 that has a dynamic toolbar which is loaded when the NewInspector event fires.  The toolbar has a commandbarpopup that has commandbarbutton's added from a list.  What I want to do is refresh the buttons when adds/deletes are applied to the list.  The commandbarbuttons also have a handler for the click event, so these would need to be removed before the new buttons are added.  My code for loading the buttons is as follows:

                For Each item In m_listoptions
                    btn = mnu.controls.add(Office.MsoControlType.msoControlButton, 1, "", 1, True)
                    With btn
                        .Caption = item.Name.ToString()
                        .Tag = item.Option.ToString()
                    End With

                    AddHandler btn.Click, AddressOf Button_Click
                Next  

I am using VSTO Visual Studio 2008 targetting Outlook 2003
0
inkineu
Asked:
inkineu
1 Solution
 
CodeCruiserCommented:
You can add all the btns, that you add to a menu, to a list. And then use the mnu.Controls.Remove(btn) to remove them. You dont need to worry about the handlers.
0
 
inkineuAuthor Commented:
Sorry for the delay, I'm running into problems with the controls.add statement.  Looks like some of the buttons are not appearing.  I'll need to run it in debug mode to see what's actually happening.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now