direction Property
Sets or returns a String that represents the direction in which text scrolls in a marquee.
expression.direction
*expression * Required. An expression that returns one of the objects in the Applies To list.
Remarks
The String for the direction property can be one of the following values:
left |
Marquee scrolls left. Default value. |
right |
Marquee scrolls right. |
down |
Marquee scrolls down. |
up |
Marquee scrolls up. |
Example
The following example inserts a MARQUEE element into the active document, and then sets the behavior, direction, number of times to loop, height, width, vertical alignment, and border of the new element.
Sub InsertMarquee(strBehavior As String, strDirection As String, strLoop As String, _
strHeight As String, strWidth As String, strVAlign As String, _
strBorder As String, strText As String)
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 = strBehavior
.direction = strDirection
.loop = strLoop
.Height = strHeight
.Width = strWidth
With .Style
.verticalAlign = strVAlign
.Border = strBorder
End With
.innerText = strText
End With
End Sub
Use the following example to call the preceding subroutine.
Sub CallInsertMarquee()
Call InsertMarquee("slide", "up", "5", _
"100%", "10%", "middle", "dashed thick red", _
"This is a scrolling marquee.")
End Sub
Applies to | FPHTMLMarqueeElement Object | IHTMLMarqueeElement Object