Sub Test() Dim intCounter As Integer Dim Ws As Workspace Dim s As String For intCounter = 1 To Workspaces.Count Set Ws = Workspaces(intCounter) s = s & Ws.Name & vbCr Next intCounter MsgBox "The current document contains the following workspaces: " & vbCr & s Set Ws = NothingEnd Sub
Sub Test() Dim Ws As Workspace Dim s As String For Each Ws In Workspaces s = s & Ws.Name & vbCr Next Ws MsgBox "The current document contains the following workspaces: " & vbCr & s Set Ws = NothingEnd Sub