InfoConnect VBA Guide
Attachmate.Reflection.Objects.Web.Msie Library / WebElement Object / TagName Property
Example
In This Topic
    TagName Property
    In This Topic
    Gets the name of the HTML tag.
    Syntax
    expression.TagName As String
    where expression is a variable that represents a WebElement Object
    Example
    This example navigates to a Web page and clicks on a link in the page. it also prints the tag name of one of the Web elements. To run this sample, create and open a Web session and run this code in the session code module.
    Sub webClick()
        
        'Declare variables: 
        Dim wControl As Attachmate_Reflection_Objects.WebControl
        Dim wDocument As WebDocument
        Dim wElement As WebElement
        Dim wElementInput As WebElement   
     
        Set wControl = ThisWebControl
        
        'Get a handle to the workspace
        Set app = GetObject("InfoConnect Workspace")
     
        'Go to the Host Access Analyzer documentation page
        wControl.Navigate1 ("https://www.microfocus.com/documentation/host-access-analyzer/")
                
        '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
        
        'Get the table that includes the link
        Set wElement = wDocument.GetElementById("getting_started")
        
        'Get the link element
        Set wElementInput = wElement.GetElement("tbody/tr[0]/td[0]/a[0]")
     
        
        'Click the link
        wElementInput.Click
        
        'Print the tag name of the element
        Debug.Print wElementInput.tagName
        
    End Sub
    See Also