API Documentation > CorelDRAW > 2025-v26 > Application > IVGApplication
Application.OpenDocument method
Opens a document
Syntax:
Function OpenDocument(ByVal FileName As String, Optional ByVal CodePage As Long = 0) As Document
Parameters:
Name Type Description
FileName
String
CodePage
Long
Specifies the document encoding (code page or character set) to use for the document.
Remarks:
The OpenDocument method opens an existing document in CorelDRAW.
Examples:
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
The following VBA example opens an existing Corel DESIGNER (DES) 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.des")
With doc
  .AddPages (1)
  .ActiveLayer.CreateEllipse(0, 3, 5, 1).Fill.UniformColor.CMYKAssign 0, 100, 100, 0
  .Save
End With 
End Sub