How can I programatically hide the "Shapes" window in Visio 2003?

M

Miha_127

I am opening a visio (2003) drawing file through a webbrowser control in a VB
application. I don't want to have the "Shapes" window displayed. I found a
registry key "FindShapesDisplay" that if set to 0 it prevents the display of
the "Shapes" window. But this doesn't seem to work consistently. Is there any
other way to programatically hide this window?
 
L

LarryF

If by "Shapes" window, you mean a stencil that you load, you can tell
Visio not to display it when you load it:
app.Documents.OpenEx(fileName, (short)(Visio.VisOpenSaveArgs.visOpenRO
| Visio.VisOpenSaveArgs.visOpenHidden));

If you are talking about some other window, you can use the Visible
property, as in:
For Each win As Visio.Window In VisX.Window.Windows
win.Visible = False
Next
 
M

Miha_127

Larry,

Thanks for your reply.

I want to open the stencil in visible mode, but I don't want it docked to
the "Shapes window". In Visio 2003 if you open a stencil over an existing
drawing, it will open docked to this "Shapes window" (a docked area where you
can search for shapes). You can manually undock the stencil and then close
this window and re-dock the stencil, but I cannot do all these
programatically.

The VB code I am using:

WebBrowser1.Navigate "D:\Tmp\newD.vsd"
Set visApp = WebBrowser1.Document.Application
visApp.Documents.OpenEx "D:\Tmp\Stencil.vss", visOpenRO

Another thing is that I couldn't find a way to open the stencil in floating
mode. I don't use visOpenDocked as argument for OpenEx method, but still the
stencil opens docked.
 
B

bnk

myWindow.Windows.GetItemFromID(visWinIDShapeSearch).Visible = False

Try searching this group by keyword "visWinIDShapeSearch"
 
M

Miha_127

Thanks for the tip.
It works partially :) It hides the "search for shapes" part, but the caption
"Shapes" is still there. If I manually undock the stencil from the "Shapes"
window then the code works fine. I still didn't figure out how to undock the
stencil window programatically. Using "win.WindowState = visWSFloating" for
the stencil window, undocks the "Shapes" window, keeping the stencil docked
to it.
 

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