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