Returns the specified strAttributeName attribute for an IHTMLFrontPageBotElement object.
expression.getBotAttribute(strAttributeName)
expression An expression that returns a IHTMLFrontPageBotElement object.
strAttributeName Required String. The string that represents the name of the attribute.
Variant
This example uses the getBotAttribute method to initially get the attributes, check if the search bot was correctly set, and then later, it checks if the search bot was deleted.
Private Sub AccessBots()
Dim myMyFPBot As FPHTMLFrontPageBotElement
Dim myBodyObject As FPHTMLBody
Dim myHTMLString As String
Dim myPage As PageWindow
myHTMLString = ""
myHTMLString = myHTMLString & _
"<!--webbot bot=""Search"" s-index=""All"""
myHTMLString = myHTMLString & _
" s-fields s-text=""Search for:"""
myHTMLString = myHTMLString & _
"i-size=""20"" s-submit=""Start Search""
myHTMLString = myHTMLString & _
" s-clear=""Reset"" s-timestampformat=""%m/%d/%y"""
myHTMLString = myHTMLString & " tag=""BODY"" -->"
Set myBodyObject = ActivePageWindow.Document.body
Set myPage = ActivePageWindow
Call myBodyObject.insertAdjacentHTML("BeforeEnd", _
myHTMLString)
Set myMyFPBot = _
myPage.Document.all.tags("webbot").Item(0)
Debug.Print myMyFPBot.getBotAttribute("s-submit")
Call myMyFPBot.setBotAttribute("s-submit", "new item")
Debug.Print myMyFPBot.getBotAttribute("s-submit")
Call myMyFPBot.removeBotAttribute("s-submit")
Debug.Print myMyFPBot.getBotAttribute("s-submit")
End Sub