Previous Document Next Document

Object Model Reference : Classes : D : Document : Methods : Document.InsertPages


Document.InsertPages

Function InsertPages(NumberOfPages As Long, BeforePage As Boolean, Page As Long) As Page

Description

Member of Document

The InsertPages method inserts blank pages in a document. The first page added is returned. You can specify if the pages are inserted before the active page.

Parameter
Description
NumberOfPages
Specifies the number of pages to add to a document
BeforePage
Specifies whether the pages are inserted before the active page in the document
Page
Specifies the page where new pages are inserted

VBA example

The following VBA example adds four new pages before the current page and creates a locked rectangle with different fountain fills on each new page.

Sub Test()
 Const NumPages As Long = 4
 Dim p As Page
 Dim Idx As Long, i As Long
 Set p = ActiveDocument.InsertPages(NumPages, True, ActivePage.Index)
 Idx = p.Index
 For i = Idx To Idx + NumPages - 1
  Set p = ActiveDocument.Pages(i)
  With p.ActiveLayer.CreateRectangle(0, 0, p.SizeWidth, p.SizeHeight)
   .Fill.ApplyFountainFill CreateRGBColor((i - Idx) * 255 / NumPages, 0, 0), _
    CreateRGBColor(0, 0, 0)
   .Locked = True
  End With
 Next i
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.