Show / Hide Shapes Window

Started by vojo, August 31, 2008, 04:46:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vojo

I am trying to show/hide shapes window reliably (that is the operative phrase here) in VBA

Tried visio.application.docmd(1669)....works most of the time
Tried visio.applicaiton.windows.itemex("shapes") in several flavors...does not seem to hide well either.

Any advice on best to do this.

Lars-Erik

#1
Try: Application.ActiveWindow.Windows.ItemFromID(visWinIDCustProp).Close

Here's a list of window ID's
Use the constant, the name, not the number

-Lars

Visio Guy

The Shapes window hangs off of existing drawing windows. So you might try something like this:


Dim winShapeSearch as Visio.Window
Set winShapeSearch  =  Visio.ActiveWindow.Windows.ItemFromID(Visio.VisWinTypes.visWinIDShapeSearch)
winShapeSearch.Visible = False


Visio.ActiveWindow must be a drawing window, or you'll probably get an error. Windows have a .Type property that can be checked.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

vojo

Tried that yesterday...same result about 7 out of 10.

Turns out, it apears there is a modality factor involved here.   One needs to be conscious of the
sequence one of actions on UI and has to do the reverse to get back out.

   - turn off shape window
   - turn off toolbars
   - etc

   - do somthing

   - etc
   - turn on toolbars
   - turn on shape window

This works 100% time

Visio Guy

You know, I always had a weird feeling about this, but I never really tracked it down and isolated it. Hmm....
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010