Previous Document Next Document

Object Model Reference : Classes : A : Application : Methods : Application.CreateDocumentFromTemplate


Application.CreateDocumentFromTemplate

Function CreateDocumentFromTemplate(Template As String, [IncludeGraphics As Boolean = True]) As Document

Description

Member of Application

The CreateDocumentFromTemplate method creates a new document based on a template in CorelDRAW.

Parameter
Description
Template
Specifies the filename of a template
IncludeGraphics
Specifies whether to include graphics from the template in the new document. This parameter is optional, and its default value is True.

VBA example

The following VBA example creates a new document based on the template webtemplate_001.cdt and adds text content to each text block.

Sub Test()
 Dim d As Document
 Dim s As Shape
 Set d = CreateDocumentFromTemplate(Path & "Template\Web\webtemplate_001.cdt", True)
 For Each s In d.ActivePage.Shapes
  If s.Type = cdrTextShape Then
   s.Text.Contents = s.Name
  End If
 Next s
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.