ElementCollection Collection

SharePoint Designer Developer Reference

Represents a collection of elements in an HTML document.

Interfaces
This object implements the following interfaces

Remarks

Use the all property of the DesignerDocument object to return a collection of all the elements in a document, including elements in the HEAD element. The following example accesses all elements in the active document.

Visual Basic for Applications
Dim objElements As ElementCollection
Set objElements = ActiveDocument.all

Use the all property of the BodyElement object to return a collection of all elements in the BODY element of a document. The following example accesses all elements in the body of the active document.

Visual Basic for Applications
Dim objElements As ElementCollection
Set objElements = ActiveDocument.body.all

Use the tags method to return a collection of a specific elements. The following example accesses all P elements in the active document.

Visual Basic for Applications
Dim objParagraphs As ElementCollection
Set objParagraphs = ActiveDocument.body.all.tags("p")

See Also