Share via


IXMLDOMNodeList.length (Visual Basic .NET)

banner art

Previous Next

IXMLDOMNodeList.length (Visual Basic .NET)

The length property indicates the number of items in the IXMLDOMNodeList collection.

Syntax

  Integer = IXMLDOMNodeList
  .length

Remarks

The property is read-only.

Example Code

The following example creates an IXMLDOMNodeList object and then uses its length property to retrieve the total number of "media" elements.

Imports interop_msxml
Imports Microsoft.WindowsMediaServices.Interop

On Error GoTo Err

' Declare variables.
Dim Server As New WMSServerClass()
Dim Playlist As New MSXML2.FreeThreadedDOMDocument
Dim nodeList As MSXML2.IXMLDOMNodeList

' Create a new playlist object.
Set Playlist = Server.CreatePlaylist

' Load a playlist.
Playlist.Load (("file://c:\wmpub\wmroot\simple.wsx"))

' Retrieve all elements with the tag name "media" 
' and display the total count.
Set nodeList = Playlist.getElementsByTagName("media")
MsgBox nodeList.length

Exit Sub

Err:
' TODO: Handle errors.

Requirements

Reference: Add references to Microsoft.WindowsMediaServices and interop_msxml.

Namespace: Microsoft.WindowsMediaServices.Interop, interop_msxml.

Assembly: Microsoft.WindowsMediaServices.dll, interop_msxml.dll.

Library: WMSServerTypeLib.dll, msxml.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next