Visio Guy

Visio Discussions => Programming & Code => Topic started by: Gustavo on November 08, 2019, 07:49:38 PM

Title: Undocking stencil window from the Shape Search window programatically
Post by: Gustavo on November 08, 2019, 07:49:38 PM
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!
Title: Re: Undocking stencil window from the Shape Search window programatically
Post by: wapperdude on November 09, 2019, 03:19:34 AM
You might find this of interest, it's a bit long.  http://visguy.com/vgforum/index.php?topic=124.0 (http://visguy.com/vgforum/index.php?topic=124.0)