Length Property
Returns a Long that represents the number of objects in a specified collection.
expression.Length
*expression * Required. An expression that returns one of the objects in the Applies To list.
Example
The following example inserts a MARQUEE element that contains the selected text. It uses the Length property to get the number of MARQUEE elements already in the document.
Sub InsertMarqueeWithSelectedText()
Dim objElement As IHTMLElement
Dim objRange As IHTMLTxtRange
Dim objMarquee As FPHTMLMarqueeElement
Dim lngCount As Long
Dim strID As String
lngCount = ActiveDocument.all.tags("marquee").Length
strID = "marquee" & lngCount + 1
Set objRange = ActiveDocument.selection.createRange
objRange.pasteHTML "<marquee id=""" & strID & """>" & _
objRange.Text & "</marquee>"
End Sub
Applies to | FPHTMLCMimeTypes Object | FPHTMLCPlugins Object | FPHTMLFiltersCollection Collection | FPHTMLFormElement Object | FPHTMLHistory Object | FPHTMLSelectElement Object | FPHTMLStyleSheetsCollection Object | FPHTMLWindow2 Object | FPHTMLWindowProxy Object | FPLayoutTablesAndCells Collection | IFPLayoutTablesAndCells Collection | IHTMLAreasCollection Collection | IHTMLElementCollection Collection | IHTMLFiltersCollection Collection | IHTMLFormElement Object | IHTMLFramesCollection2 Object | IHTMLMimeTypesCollection Object | IHTMLPluginsCollection Object | IHTMLSelectElement Object | IHTMLStyleSheetRulesCollection Collection | IHTMLStyleSheetsCollection Object | IHTMLWindow2 Object | IOmHistory Object