Reflection Desktop VBA Guide
Attachmate.Reflection.Objects Library / Attachmate.Reflection.Objects.UserInterface Library / Frame Object / AllViews Property
Example
In This Topic
    AllViews Property
    In This Topic
    Gets all views.
    Syntax
    expression.AllViews As View() object 
    where expression is a variable that represents a Frame Object

    Property Value

    An array of View objects
    Remarks

    If you are developing a Microsoft Office macro, use a Variant type when enumerating through a set as shown in the GetAllViewsWithMicrosoftOffice sample shown below. Do not use a View type as an enumerator in a Microsoft Office macro.

    If you are developing a macro in a OpenText product, you can use a Variant type or a View type for the enumerator.

    Example
    This sample gets all of the running views and prints the number of views and the title of each view.
    'Use this sample when developing macros in Microsoft Office products. 
    'This sample also works in macros developed in OpenText products.
    Public Sub GetAllViewsWithMicrosoftOffice()
        'Declare object variables for the Application and Frame Objects
        Dim app As Attachmate_Reflection_Objects_Framework.ApplicationObject
        Dim f As Attachmate_Reflection_Objects.Frame
     
        'Get a handle to the Application object
        Set app = GetObject("Reflection Workspace")
        
        'Get the Frame object
        Set f = app.GetObject("Frame")
        Debug.Print "count=" & f.ViewCount
        
        'Get all the view objects in the frame and print the title of each view
        Dim myView As Attachmate_Reflection_Objects.view
        Dim v As Variant
        For Each v In f.allViews
            Set myView = v
            Debug.Print "View title = " & myView.titleText
        Next
    End Sub
    See Also