setBotAttribute 方法

       

设置 FPHTMLFrontPageBotElement 对象的属性。

expression.setBotAttribute(strAttributeName, AttributeValue)2)

expression  返回 FPHTMLFrontPageBotElement 对象的表达式。

strAttributeName  必选,String 类型。

AttributeValue)2  必选,Variant 类型。

返回类型

Void

示例

本示例使用 setBotAttribute 方法来设置搜索组件。

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