removeBotAttribute Method

Microsoft FrontPage Visual Basic

removeBotAttribute Method

Removes the attribute specified by the strAttributeName attribute. Returns a Boolean that represents whether the attribute was removed. True indicates the attribute was successfully removed.

expression.removeBotAttribute(strAttributeName)

expression    Required. 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 uses the removeBotAttribute method to remove a search bot.

    Private Sub AccessBots()
    Dim objFPBot As FPHTMLFrontPageBotElement
    Dim objBody As FPHTMLBody
    Dim strBot As String
    Dim objPage As PageWindow

    strBot = ""
    strBot = strBot & "<!— webbot bot=""Search"" s-index=""All"""
    strBot = strBot & " s-fields s-text=""Search for:"""
    strBot = strBot & " i-size=""20"" s-submit=""Start Search"""
    strBot = strBot & " s-clear=""Reset"" s-timestampformat=""%m/%d/%y"""
    strBot = strBot & " tag=""BODY"" -->"
    
    Set objBody = ActivePageWindow.Document.body
    Set objPage = ActivePageWindow
    
    Call objBody.insertAdjacentHTML("BeforeEnd", _
        strBot)
    
    Set objFPBot = _
        objPage.Document.all.tags("webbot").Item(0)
    
    MsgBox objFPBot.getBotAttribute("s-submit")
    
    objFPBot.setBotAttribute "s-submit", "new item"
    MsgBox objFPBot.getBotAttribute("s-submit")
    
    objFPBot.removeBotAttribute "s-submit"
    MsgBox objFPBot.getBotAttribute("s-submit")
End Sub