Share via


loop Property

Sets or returns an Integer that represents the number of times a marquee or a sound or video clip will loop when activated.

expression.loop

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

Remarks

The default value of the loop property is 1. Setting the loop property to -1 will cause the specified object to loop indefinitely.

Example

The following example adds a MARQUEE element to the active document and then sets the behavior, direction, number of times to loop, height, width, and border and font formatting of the new element.

Sub SetMarqueeValues()
    Dim objMarquee As FPHTMLMarqueeElement

    ActiveDocument.body.insertAdjacentHTML where:="afterbegin", _
        HTML:="<marquee id=""newmarquee""></marquee>"

    Set objMarquee = ActiveDocument.all.tags("marquee").Item("newmarquee")

    With objMarquee
        .behavior = "slide"
        .direction = "up"
        .loop = 5
        .Height = "100%"
        .Width = "10%"
        With .Style
            .verticalAlign = "middle"
            .fontStyle = "italic"
            .Border = "dashed thick red"
        End With
        .innerText = "This is a scrolling Marquee."
    End With
End Sub

Applies to | FPHTMLBGsound Object | FPHTMLImg Object | FPHTMLInputImage Object | FPHTMLMarqueeElement Object | IHTMLBGsound Object | IHTMLImgElement Object | IHTMLInputImage Object | IHTMLMarqueeElement Object