OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Create Menu and submenus - VBA (http://forum.oberonplace.com/showthread.php?t=8185)

FaneDuru 05-05-2012 06:48

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...

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:

Application.CommandBars.Item("Menu Bar").Reset
Thanks in advance!

cha 24-05-2012 02:18

I tried the same but i'm using vb.net(2010). I wrote a small program for me to make some things easier for me. In my Form i have insert a MenuStrip.
There it works fine with

draw.FrameWork.CommandBars("Menu Bar").Controls.Add("bc6d3e54-d8cd-449a-aa61-cd442d6617eb", "xx")
draw is defined as Coreldraw.application in my case.

The ControlID is stored in xml-file..there is a thread that could help you:


Maybe this helps

All times are GMT -5. The time now is 17:36.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com