Project 2007 Beta2: custom menu onaction does not work

D

Developer

Hello,
For some reason the following code stopped working in Project 2007 Beta2.
Have there been any changes in setting up the menu handlers?

Public Sub TestMenu()
Dim customBar As CommandBar
Dim newButton As CommandBarButton

Set customBar = CommandBars("Menu Bar")
customBar.Reset


Set mymenu = CommandBars("Menu Bar").Controls.Add(Type:=msoControlPopup,
Before:=7)
mymenu.caption = "My Menu"

Dim command As CommandBarButton
Set command = mymenu.Controls.Add

command.caption = "Say Hello"
command.OnAction = "msgbox ""Hello!"""

End Sub
 
R

Rod Gill

There may well have been because of the new menu system for Office. Try
recording a macro of you creating a new menu then see what gets recorded. If
you think you've found a bug, report it to the Microsoft Beta site so they
can fix it.
 
D

Developer

Hi Rod,

Thanks for the suggestion. I was not aware that one can change onaction
using UI. How would you go about doing that?

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top