Reflection Desktop VBA Guide
Attachmate.Reflection.Objects Library / Attachmate.Reflection.Objects.UserInterface Library / Frame Object / GetViewsByName Method
The name to match
In This Topic
    GetViewsByName Method
    In This Topic
    Gets a collection of views that matches the name.
    expression.GetViewsByName( _
       ByVal name As String _
    ) As View() object 
    where expression is a variable that represents a Frame Object


    The name to match

    Return Value

    A array of View objects that match the specified name.

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

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

    This sample gets all of the running views and prints the number of views and the title of each view.
    Public Sub GetRunningViewsByName()
        'Declare object variables for the Application and Frame Objects
        Dim app As Attachmate_Reflection_Objects_Framework.ApplicationObject
        Dim f As Attachmate_Reflection_Objects.Frame
        'Declare variables for views
        Dim myView As Attachmate_Reflection_Objects.view
        Dim v As Variant
        Dim allViews As Variant
        'Get a handle to the Application object
        Set app = GetObject("Reflection Workspace")
        'Get the Frame object and print the number of views
        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
        allViews = f.GetViewsByName("")
        For Each v In allViews
            Set myView = v
            Debug.Print "View title = " & myView.titleText
    End Sub
    See Also