API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.AddPagesEx method
Appends pages to a document at a specified width and height
Syntax:
Function AddPagesEx(ByVal NumberOfPages As Long, ByVal Width As Double, ByVal Height As Double) As Page
Parameters:
Name Type Description
NumberOfPages
Long
Width
Double
Height
Double
Remarks:
The AddPagesEx method adds pages, with a specified height and width, to a document. The first page added is returned.
Examples:
The following VBA example opens an existing CorelDRAW document, adds a page to the document that has a width and height of 10 document units, creates a colored ellipse on the new page, and saves the entire document.
Sub DocumentOpen()
Dim doc As Document
Set doc = OpenDocument("C:\Flower.cdr")
With doc
  .AddPagesEx 1, 10, 10
  .ActiveLayer.CreateEllipse(0, 3, 5, 1).Fill.UniformColor.CMYKAssign 0, 100, 100, 0
  .Save
End With 
End Sub