webbots Property

       

Returns an IHTMLElementCollection collection that represents the collection of all webbots in the current document.

expression.webbots

expression   Required. An expression that returns a DispFPHTMLDocument object.

Remarks

This collection is indexed first by name, then by identifier. If duplicate names are found, a collection of those named items is returned. Collections of duplicate names must subsequently be referenced by ordinal position.

Example

The following example creates a reference to the current document's webbots collection and displays the number of webbots in the current page.

Sub ReturnWebBots()
'Returns the collection of all webbots in the document

    Dim objApp As FrontPage.Application
    Dim objBots As IHTMLElementCollection
    Dim objBot As IHTMLElement
    Dim intCount As Integer

    intCount = 0
    Set objApp = FrontPage.Application
    Set objBots = objApp.ActiveDocument.webbots
    'For each webbot in the document
    For Each objBot In objBots
       'Keep count of number of webbots
       intCount = intCount + 1
    Next objBot

    'Display number of webbots in collection
    If intCount = 0 Then
        MsgBox "There are no webbots in the current document."
    Else
        MsgBox "There are " & intCount & " webbots in the current document."
    End If

End Sub