View Single Post
  #1  
Old 05-05-2012, 06:48
FaneDuru FaneDuru is offline
Member
 
Join Date: May 2012
Posts: 35
Question Create Menu and submenus - VBA

I am experienced enough in working with VBA Excel. Now I started working in Corel Draw (X5) and I try to make a menu with submenus in existing 'Menu bar'. I tried to find similar threads but I couldn't find something to make things clear enough. I mean there are possibilities to do that using XML but I would like to know if it is possible on not to make that using only VBA.
I found some code and using the next one and a refference to 'Corel - VGC 15.0 Type library' I could create a Menu (control) between the existing ones, but I do not know how to create submenus, to allocate procedures to that...
Code:
Dim oButton As CommandBarControl
Set oButton = Application.CommandBars.Item("Menu Bar").Controls.AddCustomButton("2cc24a3e-fe24-4708-9a74-9c75406eebcd", "Test", 8, False)
With oButton
    .Visible = True
    .ToolTipText = "Test..."
End With
Since I am able to create it I suppose that it sould possible to do also what I need.
If you know that it is not possible using just VBA I will try it using XML, but I would preffer VBA...
Is there another GUID to be used for meniu creation? It looks I created a button, not a menu...

I delete the new Meniu/Control using:
Code:
Application.CommandBars.Item("Menu Bar").Reset
Thanks in advance!
Reply With Quote