here's a vb.net version that you should be able to modify, I've included the
visio window types as well
al
Private Sub setVisioExtraWindowVisibility( _
ByVal targetWindow As Microsoft.Office.Interop.Visio.Window, _
ByVal visVWT As Microsoft.Office.Interop.Visio.VisWinTypes, _
ByVal visible As Boolean)
Dim searchWindow As Microsoft.Office.Interop.Visio.Window
Try
' for identified window set the visibility attribute
searchWindow = targetWindow.Windows.ItemFromID(visVWT)
If (Not searchWindow Is Nothing) Then
searchWindow.Visible = visible
End If
Catch err As Exception
System.Diagnostics.Debug.WriteLine(err.Message)
End Try
End Sub
It uses some constants for window types that I renamed
Public Const visVWTAnchorBarAddon As Integer = 10
' Window created by an add-on that has tabs at the bottom when merged
(floating, anchored, or docked window)
Public Const visVWTAnchorBarBuiltIn As Integer = 6
' Visio built-in window that has tabs at the bottom when merged- presently,
the Custom Properties, Size & Position, Drawing Explorer, Master Explorer,
and Pan & Zoom windows (floating, anchored, or docked windows).
Public Const visVWTApplication As Integer = 5
' Microsoft Office Visio application window.
Public Const visVWTDockedStencilAddon As Integer = 11
'An add-on window that has docked stencil behavior.
Public Const visVWTDockedStencilBuiltIn As Integer = 7
' Stencil window docked in a drawing window.
Public Const visVWTDrawing As Integer = 1
' Drawing window (MDI frame window).
Public Const visVWTDrawingAddon As Integer = 8
'Drawing window created by an add-on (MDI frame window).
Public Const visVWTIcon As Integer = 4
'Icon editing window (MDI frame window).
Public Const visVWTInvalWinID As Integer = -1
'Window has no ID.
Public Const visVWTMasterGroupWin As Integer = 96
'A group editing window of a group in a master.
Public Const visVWTMasterWin As Integer = 64
'A master drawing page window.
Public Const visVWTPageGroupWin As Integer = 160
'A group editing window of a group on a page.
Public Const visVWTPageWin As Integer = 128
'A drawing window showing a page.
Public Const visVWTSheet As Integer = 3
'ShapeSheet window (MDI frame window).
Public Const visVWTStencil As Integer = 2
'Stencil window (MDI frame window).
Public Const visVWTStencilAddon As Integer = 9
'Add-on window that has stencil window behavior.
Public Const visVWTWinIDCustProp As Integer = 1658
'When Window.Type is visAnchorBarBuiltIn, Custom Properties window.
Public Const visVWTWinIDDrawingExplorer As Integer = 1721
'When Window.Type is visAnchorBarBuiltIn, Drawing Explorer window.
Public Const visVWTWinIDFormulaTracing As Integer = 1781
'When Window.Type is visAnchorBarBuiltIn, ShapeSheet Formula Tracing window.
Public Const visVWTWinIDMasterExplorer As Integer = 1916
'When Window.Type is visAnchorBarBuiltIn, Master Explorer window in master
editing window.
Public Const visVWTWinIDPanZoom As Integer = 1653
'When Window.Type is visAnchorBarBuiltIn, Pan & Zoom window.
Public Const visVWTWinIDShapeSearch As Integer = 1669
'When Window.Type is visAnchorBarBuiltIn, Shapes window.
Public Const visVWTWinIDSizePos As Integer = 1670
'When Window.Type is visAnchorBarBuiltIn, Size & Position window.
Public Const visVWTWinIDStencilExplorer As Integer = 1796
'When Window.Type is visAnchorBarBuiltIn, Drawing Explorer window in MDI
stencil window.
Public Const visVWTWinOther As Integer = 0
'Unknown window type.