API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.Pages property
Returns the Pages collection, which represents all pages in the document
Syntax:
Property Get Pages() As Pages
Remarks:
The Pages property returns the Pages collection, which represents all pages in the document.
Examples:
The following VBA example creates black rectangles at the bottom of each page starting from the current page to the end of the document.
Sub Test()
Dim idx As Long, i As Long
Dim doc As Document
Dim p As Page
Dim s As Shape
Set doc = ActiveDocument
idx = doc.ActivePage.Index
For i = idx To doc.Pages.Count
  Set p = doc.Pages(i)
  Set s = p.ActiveLayer.CreateRectangle(0, 0, p.SizeWidth, 0.5)
  s.Fill.UniformColor.CMYKAssign 0, 0, 0, 100
Next i 
End Sub