getBotAttribute Method

Microsoft FrontPage Visual Basic

getBotAttribute Method

Returns a Variant that represents the specified strAttributeName attribute for a specified object, which represents a Microsoft FrontPage component inserted into a Web page.

expression.getBotAttribute(strAttributeName)

expression    An expression that returns one of the objects in the Applies To list.

strAttributeName    Required String. The string that represents the name of the attribute.

Example

This example inserts the FrontPage Search component, and then uses the getBotAttribute method to return the inserted object.

    Private Sub AccessSearchComponent()
    Dim objComponent As FPHTMLFrontPageBotElement
    Dim objBody As FPHTMLBody
    Dim strHTML As String
    Dim objWindow As PageWindow
    
    strHTML = "<!--webbot bot=""Search"" s-index=""All""" & _
        " s-fields s-text=""Search for:""" & _
        " i-size=""20"" s-submit=""Start Search""" & _
        " s-clear=""Reset"" s-timestampformat=""%m/%d/%y""" & _
        " tag=""BODY"" -->"
    
    Set objBody = ActivePageWindow.Document.body
    Set objWindow = ActivePageWindow
    
    objBody.insertAdjacentHTML "BeforeEnd", strHTML
    
    Set objComponent = objWindow.Document.all.tags("webbot").Item(0)
    
    MsgBox objComponent.getBotAttribute("s-submit")
    objComponent.setBotAttribute "s-submit", "new item"
    
    MsgBox objComponent.getBotAttribute("s-submit")
    objComponent.removeBotAttribute "s-submit"
    
    MsgBox objComponent.getBotAttribute("s-submit")
End Sub