Reflection Desktop VBA Guide
Attachmate.Reflection.Objects Library / Attachmate.Reflection.Objects.Web.Msie Library / WebControl Object / ReadyState Property
Example
In This Topic
    ReadyState Property
    In This Topic
    Gets the ready state of the Web browser.
    Syntax
    expression.ReadyState As WebBrowserReadyState
    where expression is a variable that represents a WebControl Object

    Property Value

    A WebBrowserReadyState value.
    Example
    This example opens a Web session, waits a few seconds, and closes the session without saving. To run this sample, create and save a Web session named OpenWebDemo.urlx. Then open any session and copy this code to a module in the Common project.
    Sub createAndCloseWebSession()
        'Declare application, terminal, and view object variables:
        Dim app As Attachmate_Reflection_Objects_Framework.ApplicationObject
        Dim wControl As Attachmate_Reflection_Objects.WebControl
        Dim wDocument As WebDocument
        Dim view As Attachmate_Reflection_Objects.view
        Dim rcode As ReturnCode
        Dim path As String
            
        'Get a handle to the workspace
        Set app = GetObject("Reflection Workspace")
     
        'Open a session to create a Web control
        path = Environ$("USERPROFILE") & "\Documents\Micro Focus\Reflection\" & "OpenWebDemo.urlx"
        Set wControl = app.CreateControl(path)
       
        'Wait until the Web page is ready and then set it as the Web document
        Do Until wControl.ReadyState = WebBrowserReadyState_Complete
          app.Wait (1000)
        Loop
        
        Set wDocument = wControl.Document
     
        'Set a view to make the session visible
        Set view = ThisFrame.CreateView(wControl)
        
        'send additional commands to work with the session
        app.Wait (5000)
        
        'Close the session without saving
        rcode = wControl.Close(CloseOption_CloseNoSave)
     
    End Sub
    See Also