VBA toolbar Code in VSS file

S

Stef

Hi,

I try to create a toolbar in a VSS file and not in a vsd.
The macro run correctly but my toolbar never show on screen.
Can you help me ? see the code below.
Thanks in advance

Dim AUIObject As Visio.UIObject
Dim AToolBarSet As Visio.ToolbarSet
Dim AToolBarItems As Visio.ToolbarItems
Dim AToolBarItem As Visio.ToolbarItem
Dim AtoolBar As Visio.Toolbar


Set AUIObject = Visio.Documents.Application.BuiltInToolbars(0)

Set AToolBarSet = AUIObject.ToolbarSets.ItemAtID(visUIObjSetDrawing)
Set AtoolBar = AToolBarSet.Toolbars.Add
AtoolBar.Caption = "toto"
AtoolBar.Position = visBarTop

Set AToolBarItems = AtoolBar.ToolbarItems

Set AToolBarItem = AToolBarItems.AddAt(0)

AToolBarItem.Caption = "Open SubProg"
AToolBarItem.ActionText = "Open SubProg"
AToolBarItem.AddOnName = "Open SubProg"
AToolBarItem.CntrlType = visCtrlTypeBUTTON
AToolBarItem.Style = visButtonCaption

ThisDocument.SetCustomToolbars AUIObject
 

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