Previous Document Next Document

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


Application.OpenDocument

Function OpenDocument(FileName As String, [CodePage As Long]) As Document

Description

Member of Application

The OpenDocument method opens an existing document in CorelDRAW.

Parameter
Description
FileName
Specifies the full path name of the existing document to open
CodePage
Specifies the document encoding (code page or character set) to use for the document. This parameter is optional, and its default value is 0.

VBA example

The following VBA example opens an existing CorelDRAW (CDR) document, adds a page to the document, 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
  .AddPages (1)
  .ActiveLayer.CreateEllipse(0, 3, 5, 1).Fill.UniformColor.CMYKAssign 0, 100, 100, 0
  .Save
 End With
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.