Visio 2007 Command Bars

A

Andy

I have implemented an application using Visio with automation (on
Visio 2003) and have created custom command bars. I am now trying to
run this application on Visio 2007, everything seems to work fine
apart from a problem with my command bars and the Visio menu bar. The
command bars do not respond once my application has been started, this
applies to both my own command bars and the Visio menu bar. However,
if I restore and then maximize the visio window, the command and menu
bars work fine. Similairly, if i start some other applicatio0n so the
visio window loses focus, the command and menu bars work fine.

This application works alright on Visio 2003.

Any help appreciated.
 
A

Andy

Private WithEvents myCommandBars As CommandBars
Private myCommandBar As CommandBar

Private myLocationCBCB As CommandBarComboBox

Private Const PCMD_CAPTION_LOCATION = "Location"

Private Const PCMD_TAG_LOCATION = "PCMD Info Location"

Private Const PCMD_TOOLTIPTEXT_LOCATION = "Current Location"

Private Sub Class_Initialize()

Set myCommandBars = Visio.Application.CommandBars

Set myCommandBar = myCommandBars("Info")

Set myCommandBar = myCommandBars.add( "Info", msoBarTop, , True)

With myCommandBar

.Context = visUIObjSetDrawing
.RowIndex = 4

Set myLocationCBCB = .Controls.add(msoControlEdit)

With myLocationCBCB

.BeginGroup = True
.Tag = "TagInfo"
.Caption = "Location"
.width = 300
.Style = msoComboLabel
.enabled = False

End With

.enabled = True
.Visible = False

.Protection = msoBarNoMove Or_
msoBarNoChangeVisible Or _
msoBarNoCustomize

myCommandBars.DisableCustomize = True

myCommandBars("Toolbar List").enabled = False

End With

End Sub
 
J

JuneTheSecond

In my Visioi2007 everything is normal, when I modify your code.
I put office. infront of CommandBars, CommandBar and CommandBarComboBox to
prevent compile error.
And I released protection and chsnged some properties tto True or False,
3-Enabled, Visible, DisableCustomize.

By the way what would you mean for the command bar by
.Enabled = True
.Visible = False

You might limit the protection and regulation to the level you really need.
 
A

Andy

My application sets the command bars visible of not dependent upon
certain conditions.
 
A

Andy

Seems to be related to the fact I hide the Visio application during
creation of the command bars. If I leave the application visible, then
the command bars behave correctly.
 

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