Author Topic: Undocking stencil window from the Shape Search window programatically  (Read 65 times)

0 Members and 1 Guest are viewing this topic.

Gustavo

  • Jr. Member
  • **
  • Posts: 40
Hi all.

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

Code: [Select]
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 :
Code: [Select]
Visio.ActiveWindow.Windows.ItemFromID(visWinIDShapeSearch).CloseBut, 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!
« Last Edit: November 08, 2019, 06:11:56 PM by Gustavo »

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3622
  • Ideas Visio-lized into solutions
Re: Undocking stencil window from the Shape Search window programatically
« Reply #1 on: November 08, 2019, 10:19:34 PM »
You might find this of interest, it's a bit long.  http://visguy.com/vgforum/index.php?topic=124.0
Visio 2019 Pro