Results 1 to 4 of 4

Thread: Solved: Converting Toolbars/Menus from 2003 to 2007

  1. #1

    Solved: Converting Toolbars/Menus from 2003 to 2007

    Hi - I'm upgrading my users from 2003 to 2007, but I can't seem to make the custom toolbars and menus convert to 2007. I'm creating them on the fly on open. Everything works great except for the OnAction. Does anyone have any experience with this? Thanks!!

    [VBA]Sub MenuXXX()
    Dim myMenuBar As CommandBar
    Dim newMenu As CommandBarControl

    Set myMenuBar = CommandBars.ActiveMenuBar
    Set newMenu = myMenuBar.Controls.Add(Type:=msoControlPopup, temporary:=True)
    newMenu.Caption = "XXX"
    With newMenu
    Set ctrl1 = newMenu.CommandBar.Controls.Add(msoControlButton, , , , False)
    With ctrl1
    .Caption = "MIPS Forecast"
    .TooltipText = "MIPS Forecast"
    .Style = msoButtonIconAndCaption
    .OnAction = ("RunLocalMips_Forecast")
    .FaceId = 645
    .BeginGroup = True
    End With
    Set ctrl2 = newMenu.CommandBar.Controls.Add(msoControlButton, , , , False)
    With ctrl2
    .Caption = "MIPS Workload"
    .TooltipText = "MIPS Workload"
    .Style = msoButtonIconAndCaption
    .OnAction = ("RunLocalMips_Workload")
    .FaceId = 2099
    End With
    Set ctrl3 = newMenu.CommandBar.Controls.Add(msoControlButton, , , , False)
    With ctrl3
    .Caption = "MIPS Milestone"
    .TooltipText = "MIPS Milestone"
    .Style = msoButtonIconAndCaption
    .OnAction = ("RunLocalMips_Milestone")
    .FaceId = 298
    End With
    End Sub[/VBA]

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master xld's Avatar
    Apr 2005
    2007 has a different UI paradigm,. I don't know about Project, but with Excel you see the old CBs on the Addins tab. If you want a proper 2007 ribbon/group, you have to create it in XML.
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    I'm not sure about that. MSProject 2007 doesn't have the xlm ribbons/chunks that you see in the rest of office, and my toolbars/menus show up normally, they just don't do anything when clicked. It's like the OnAction doesn't work for 2007. This is what I was hoping to figure out. Do you have any example code for a toolbar / ribbon creation that I could try out in 07? Perhaps it is xml and I'm just not see in properly. Thanks!!

  4. #4
    You were right. I'll look at the section for ribbon help. Thanks for pointing me in the right direction!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts