Count Property

Applies to: SharePoint Foundation 2010

Returns the number of Web Parts on the current Web Part Page.

objParts.Count

Parameters

Parameter

Description

objParts  

A reference to a Parts Collection.

Remarks

The Web Part Page Header part is included in this count if it is present on the page.

The Count property applies to the Parts Collection only; use the Count method to get the number of properties in a Properties Collection.

Example 1: Microsoft Visual Basic Scripting Edition

Code

intPartsCountCount = WPSC.WebPartPage.Parts.Count

Example 2: Microsoft JScript

Code

var intPartsCountCount = WPSC.WebPartPage.Parts.Count;

Requirements

Applies to: Parts Collection

See Also

Reference

Count Method

Properties Collection

Other Resources

Web Part Page Services Component (WPSC) Object Model