Previous Document Next Document
Application.CreateDocumentFromTemplate

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

Member of Application

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

Parameters
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.

The following code 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 2007 Corel Corporation. All rights reserved.