Does anyone know if there an object in VBA to manipulate workspaces?
|
Does anyone know if there an object in VBA to manipulate workspaces?
No. There is a .NET API for the CUI. All VBA can do is make a workspace active, via the WSCurrent system variable.
R. Robert Bell
Design Technology Manager
Stantec
Opinions expressed are mine alone and do not reflect the views of Stantec.
Thanks, Was I was looking for was the ability to list the workspaces available. I guess you can’t do that via VBA?
Yes, you can do that, using the XML API. This code is from my AU classes.
Code:Private Function GetWorkspaces(CUIFilename As String) As Variant Dim myXML As DOMDocument Set myXML = New MSXML2.DOMDocument myXML.Load CUIFilename Dim myList As MSXML2.IXMLDOMNodeList Set myList = myXML.getElementsByTagName("WorkspaceConfig") Dim myCount As Long myCount = myList.Length - 1 Dim resList As Variant ReDim resList(0 To myCount) As String Dim i As Long For i = 0 To myCount resList(i) = myList.Item(i).text Next i GetWorkspaces = resList End Function
R. Robert Bell
Design Technology Manager
Stantec
Opinions expressed are mine alone and do not reflect the views of Stantec.