To get a list of open pictures that are currently being edited or are opened within a workspace environment, the following code can be used.
Step by Step Instructions
- Create a new picture in workspace.
- Add a command button and change the name of the button to cmdGetopen.
- Insert a Combo Box (Microsoft Forms 2.0 ComboBox) from the list of OLE Object controls. Rename this control to cmbOpen.
- Copy the code below into the 'On Click' event of the command button
Private Sub cmdGetopen_Click()
Dim oTree As Object
Dim sName As String
'Go through each document that is open
For Each oTree In Application.Documents
'Assign the name and trim the remainder to have the file extension
sName = Right(oTree.Filename, 3)
' determine if the file is a GRF
If sName = "grf" Then
' Add the items to a combo box
'Move to the next item in the system tree