Undocking stencil window from the Shape Search window programatically

Started by Gustavo, November 08, 2019, 07:49:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Gustavo

Hi all.

I'm working on an solution and I required to open several stencils any given time. I'm using the code line:

Private Sub Openstencil()
Dim CurrentDir As String
CurrentDir = Application.ActiveDocument.Path
Dim vsoWindow As Visio.Window
   
On Error GoTo Err_Handler

Application.Documents.OpenEx CurrentDir & "\sys\stn\Stencil1.vssm", visOpenDocked

Exit Sub
Err_Handler:
MsgBox "An error has ocurred", vbExclamation + vbOKOnly
End Sub


I'd like to do it without opening the shape search window, like when you undock a stencil from the Shape Search window, the stencil window "floating" on the Drawing window.

I know that this line close the Shape Search window :
Visio.ActiveWindow.Windows.ItemFromID(visWinIDShapeSearch).Close
But, is it possible to "undock" my stencil from the shape search window before I close it? Or how do I open my stencils without opening the shape search window?

best regards!

wapperdude

Visio 2019 Pro