Public Sub test() Dim pDockableWindowManager As IDockableWindowManager Set pDockableWindowManager = Application Dim sUID As UID Set sUID = New UID sUID.Value = "{7F09BEFF-4F85-48A2-A3DC-39430262799E}" 'GxBrowserDockWindow Dim pDockableWindow As IDockableWindow Set pDockableWindow = pDockableWindowManager.GetDockableWindow(sUID) Debug.Print pDockableWindow.Caption ' This returns "Catalog" so I know I have a handle on it If pDockableWindow.IsVisible Then ' ??? How to refresh it it? End If End Sub
Solved! Go to Solution.
Public Sub test() Dim pMXDoc As IMxDocument Set pMXDoc = ThisDocument Dim n As Integer n = pMXDoc.ContentsViewCount Dim pContentsView As IContentsView For i = 0 To n - 1 Set pContentsView = pMXDoc.ContentsView(i) Debug.Print pContentsView.Name Next i End Sub
Richard,
Many thanks for your help but I think we are talking about different things?
I'm talking about this window:
[ATTACH=CONFIG]28077[/ATTACH]
If run the following code:Public Sub test() Dim pMXDoc As IMxDocument Set pMXDoc = ThisDocument Dim n As Integer n = pMXDoc.ContentsViewCount Dim pContentsView As IContentsView For i = 0 To n - 1 Set pContentsView = pMXDoc.ContentsView(i) Debug.Print pContentsView.Name Next i End Sub
It displays only the following names (so no catalog window):
Display
Source
Visible
Selection
Richard,
Many thanks for your help but I think we are talking about different things?
I'm talking about this window:
[ATTACH=CONFIG]28077[/ATTACH]
If run the following code:Public Sub test() Dim pMXDoc As IMxDocument Set pMXDoc = ThisDocument Dim n As Integer n = pMXDoc.ContentsViewCount Dim pContentsView As IContentsView For i = 0 To n - 1 Set pContentsView = pMXDoc.ContentsView(i) Debug.Print pContentsView.Name Next i End Sub
It displays only the following names (so no catalog window):
Display
Source
Visible
Selection
Public Sub test()
Dim pDockableWindowManager As IDockableWindowManager
Set pDockableWindowManager = Application
Dim sUID As UID
Set sUID = New UID
sUID.Value = "{7F09BEFF-4F85-48A2-A3DC-39430262799E}" 'GxBrowserDockWindow
Dim pDockableWindow As IDockableWindow
Set pDockableWindow = pDockableWindowManager.GetDockableWindow(sUID)
If pDockableWindow.IsVisible Then
' Get Browser
Dim pGXBrowser As IGxBrowser
Set pGXBrowser = pDockableWindow.UserData
' Get the Catalog
Dim pGXCatalog As IGxCatalog
Set pGXCatalog = pGXBrowser.InternalCatalog
' QI Catalog into GXObject
Dim pGXObject As IGxObject
Set pGXObject = pGXCatalog
' QI GxObject into GxObjectContainer
Dim pGxObjectContainer As IGxObjectContainer
Set pGxObjectContainer = pGXObject
' Get Gxobjects as an enumerate
Dim pEnumGxObject As IEnumGxObject
Set pEnumGxObject = pGxObjectContainer.Children
' Cycle through objects until we find the Folder Connections, then break out of loop
Dim pGxObject2 As IGxObject
Set pGxObject2 = pEnumGxObject.Next
Do While Not pGxObject2 Is Nothing
If TypeOf pGxObject2 Is IGxFolderConnections Then
Exit Do
End If
Set pGxObject2 = pEnumGxObject.Next
Loop
' Re-point GxObjectContainer to folder connection GxObject and refresh all children GxObjects
Set pGxObjectContainer = pGxObject2
Set pEnumGxObject = pGxObjectContainer.Children
Set pGxObject2 = pEnumGxObject.Next
Do While Not pGxObject2 Is Nothing
pGxObject2.Refresh
Set pGxObject2 = pEnumGxObject.Next
Loop
End If
End Sub