Previous Document Next Document
Pages.Item

Property Item(Index As Long) As Page

Member of Pages

The Item property returns the specified page of the document.

The Item property is the default property, and its reference can be omitted when accessing an item in the collection. For example, Pages.Item(2) is the same as Pages(2) — they both reference the second page in the Pages collection.

A page with an index number of 0 returns the master page. Some layers, such as Guides or Grid, are available only on the master page.

The Item property returns a read-only value.

Parameters
Description
Index
Specifies the page by its index number

The following code example places page numbers on each page in the active document:

Sub Test() 
 Dim p As Page 
 Dim i As Long 
 For i = 1 To ActiveDocument.Pages.Count 
  Set p = ActiveDocument.Pages(i) 
  p.ActiveLayer.CreateArtisticText 0, 0, "Page " & p.Index 
 Next i 
End Sub 
Sub Test() 
 Dim p As Page 
 For Each p In ActiveDocument.Pages 
  p.ActiveLayer.CreateArtisticText 0, 0, "Page " & p.Index 
 Next p 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.