PublishingWeb.GetPublishingPages method (SPQuery)

Gets a collection of PublishingPage objects contained in this PublishingWeb object.

Namespace:  Microsoft.SharePoint.Publishing
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)


Public Function GetPublishingPages ( _
    query As SPQuery _
) As PublishingPageCollection
Dim instance As PublishingWeb
Dim query As SPQuery
Dim returnValue As PublishingPageCollection

returnValue = instance.GetPublishingPages(query)
public PublishingPageCollection GetPublishingPages(
    SPQuery query


Return value

Type: Microsoft.SharePoint.Publishing.PublishingPageCollection
A PublishingPageCollection collection containing PublishingPage objects in this PublishingWeb, based on the query argument.


Exception Condition

The collection retrieval failed. The CAML query may be invalid.


The site is not valid. The Pages document library is missing.


The value cannot be set to a null reference (Nothing in Visual Basic).


Set the RowLimit property on the query parameter to indicate the paging data size.

Set the Query property on the query parameter to indicate the Collaborative Application Markup Language (CAML) query to use when retrieving the collection.


You can use the CAML <OrderBy> tag to sort the collection. For example, to order a collection in ascending order based on title, use this CAML query.

<FieldRef Name="Title" Ascending="TRUE">

You can use the CAML <Where> tag to filter the collection. For example, to filter a collection based on title matching the value "abc", use this CAML query.

<FieldRef Name="Title">
<Value Type="Text">abc</Value>

See also


PublishingWeb class

PublishingWeb members

GetPublishingPages overload

Microsoft.SharePoint.Publishing namespace