API Documentation > CorelDRAW > 2025-v26
Document class
Represents a CorelDRAW or Corel DESIGNER document
Syntax:
Class Document
Remarks:
The Document class represents a CorelDRAW document.
Properties:
Name Description
Active Returns True if the document is active
ActiveLayer Returns the active layer of the current document
ActivePage Returns the active page of the current document
ActivePowerClip Returns the current PowerClip object that is being edited
ActiveShape Returns the active shape
ActiveSpread Returns the active page spread in the document
ActiveWindow Returns the active window in the current document
Application Returns the application (CorelDRAW or Corel DESIGNER) to which the object belongs
ApplyToDuplicate Lets you specify whether to create duplicates of objects while transforming them. This property is used mainly for user interface compatibility and recording. Some commands may result in several duplicates and some may produce none. There is no way of referenc
CodeName Returns the name of VBA object module associated with this document
ColorContext Specifies the document color context
Components Returns a collection of document-specific components
ContentIdentifiers Returns object identifiers
CurvePrecision Returns or sets the linearization factor for curves
DataFields Returns the DataFields collection, which represents a list of all Object data fields defined within the document
Dirty Returns or specifies whether a document has been modified since it was last saved
DrawingOriginX Returns or specifies the horizontal drawing origin for the center of coordinates relative to the center of the page. By default, the center of coordinates is set to the lower-left corner of a page.
DrawingOriginY Returns or specifies the vertical drawing origin for the center of coordinates relative to the center of the page. By default, the center of coordinates is set to the lower-left corner of a page.
EditAcrossLayers Returns or sets the ability to edit objects that are not on the active layer
FacingPages Specifies whether facing pages should be displayed for the current document layout
FileName Returns the file name of a document if it has been saved
FilePath Returns the location of the document
FirstPageOnRightSide Specifies whether the first page in facing pages starts on the right side of the spread
FullFileName Returns the path and file name of an instance of a document
Grid Returns the grid settings for the document
HatchLibraries Returns a collection of available hatch fill libraries
Index Returns the index of the document in the Documents collection
IsCurrentVersion Returns True if the document is saved in the current file version format
IsTemporary Returns True if this document is a temporary document with no document windows
Layout Specifies the document layout type
Markup Markup associated with this document
MasterPage Returns the document master page
Math Gives access to the application's math functions
Metadata Returns the individual metadata items within a document
MultipageLayout Gets or sets the multipage view layout
MultipageLayoutColumns Gets or sets the multipage view grid layout's number of columns
MultipageLayoutSpacing Gets or sets the multipage view page spacing
Name Returns or specifies the name of the VBA object for the current document
Pages Returns the Pages collection, which represents all pages in the document
Palette Returns the document palette associated with this document
Parent Returns a read-only value that is associated with the properties, methods, and controls of an object's parent in the CorelDRAW and Corel DESIGNER hierarchy of objects. A parent object acts as a container for child objects. For example, a form (as a container)
PDFSettings Returns the PDF settings for the specified document
PreserveSelection Returns or specifies whether the current selection should always be preserved
PrintSettings Returns a reference to the Print Settings configured for the document
Properties Returns any custom properties that were saved with the document
ReferencePoint Returns or specifies the reference point for positioning every object in the document
Resolution Returns or sets the document pixel resolution in DPI
ResolutionX Returns or sets the document horizontal pixel resolution in DPI
ResolutionY Returns or sets the document vertical pixel resolution in DPI
Rulers Returns the Rulers collection for a document, letting you change the properties of the rulers in the document window
SelectableShapes Returns a collection of all the selectable shapes visible in the current view
SelectionInfo Returns the SelectionInfo object
SelectionRange Returns a collection of shapes within the selection
ShapeEnumDirection Returns or sets the order in which shapes in a collection are enumerated
SourceFileVersion Returns the document file version
SourceFormat Returns the document format
SourcePlatformVersion Returns the internal document version
Spreads Returns the collection of document page spreads
StyleSheet Returns a list of styles or stylesets and their properties within the document as a stylesheet
SymbolLibrary Returns the local symbol library of the document
TextFormatter Returns or sets the text formatter for the document
Title Returns the name of a document that has not yet been saved
TreeManager Returns the document tree manager
TreeRoot Returns the top-level document tree node
Unit Returns or specifies the unit of measurement used in the document for the position, size, and dimensions of objects
Views Returns a collection of views for the document
Windows Returns the Windows collection, which represents all document windows belonging to the current document
WorldScale Returns or sets the Drawing Scale
Methods:
Name Description
Activate Opens a document in the main application window in CorelDRAW or Corel DESIGNER, if the window is not currently open, and makes the document active
AddColorsToDocPalette Adds all the colors in the document or selection to the document color palette
AddPages Appends blank pages to the document and returns the first page added
AddPagesEx Appends pages to a document at a specified width and height
AddToSelection Adds the specified list of shapes to the current selection
AdviseEvents Advise document events
AssignColorContext Replaces the existing document color context with the new one. Document colors preserve their values and may change their appearance.
BeginCommandGroup Starts to list a group of commands, which can later be undone in a single step
ClearSelection Deselects any selected object
ClearUndoList Clears the Undo history list for the document
Clone Creates a copy of the document in memory without creating a document window
Close Closes the document
ConvertToColorContext Replaces the existing document color context with the new one. Document colors preserve their appearances and may change their values.
CreateArrowHead Creates a new outline arrowhead by using the given curve as the arrowhead shape
CreateArrowHead2 Creates a new outline arrowhead by using the given curve as the arrowhead shape, and provides its name
CreateArrowHeadEx Creates a new outline arrowhead by using the given curve as the arrowhead shape and specifying advanced arrowhead creation options
CreateArrowHeadEx2 Creates a new outline arrowhead by using the given curve as the arrowhead shape and specifying advanced arrowhead creation options, and provides its name
CreateArrowHeadOptions Creates a new outline arrowhead options object
CreateBSpline Creates an instance of a b-spline
CreateColorStyles Creates color styles or color harmonies from objects in the document or selection
CreateCurve Creates an instance of a Curve object bound to the specified document
CreateCurveFitToPoints Creates a curve fitted to an array of points
CreateCurveFitToPointsAndCusps Creates a curve fitted to an array of points, using indices of points to determine cusps
CreateCurveFromArray Creates an instance of a Curve object bound to the document by using the node information specified
CreateFill Creates a virtual fill object unattached from any shape
CreateFreeSnapPoint Creates a snap point at the given location in the document
CreateImage Creates a new pixel buffer for bitmap image
CreateOutline Creates a virtual outline object unattached from any shape
CreateSelection Creates a selection from a list of shapes
CreateShapeRangeFromArray Creates a ShapeRange object containing the specified shapes
CreateUniformFill Creates a single color fill object
CreateView Creates an instance of a custom view area, storing the page, zoom percentage and location. This custom view can be invoked later.
CustomCommand Executes a custom command on the given document
DeletePages Deletes a number of pages at a time
Duplicate Creates a new copy of the document
EndCommandGroup Ends the list of commands that can be undone in one step
Export Exports a document to a supported non-native file format
ExportBitmap Exports a document to a supported raster file format
ExportEx Exports a document to a supported non-native file format and returns an instance of ExportFilter
FromUnits Converts a given value from the current document units into the given units
GetUserArea Allows a user to specify a rectangular area by dragging. Returns top left and bottom right x,y coordinatesa and information about the state of the modifier keys, CTRL, ALT and SHIFT keys at the moment of click
GetUserClick Allows a user to click in the document, and returns the x,y coordinate and information about the state of the modifier CTRL, ALT and SHIFT keys at the time of the click
InsertPages Inserts blank pages in a document and returns the first page added.You can specify that the pages are inserted before the active page.
InsertPagesEx Inserts pages of a specified size in a document
LoadStyleSheet Loads styles from a Styles template file into the current document
LogCreateShape Logs a virtual shape creation transaction so it can be undone by the user
LogCreateShapeRange Logs shape creation transaction for a number of virtual shapes so it can be undone by the user
PrintColorProof Prints out a color proof by using the specified proofing settings
PrintOut Opens the Print dialog box
PublishToPDF Publishes the specified document to PDF
Redo Reverses the last undo operation
RemoveFromSelection Removes the specified list of shapes from the current selection
Repeat Repeats the last operation
ResetSettings Resets a set of document settings that can be saved internally, including Unit, Drawing Origin, Curve Precision, Reference Point, PreserveSelection, ShapeEnumdirection, and Apply To Duplicate
ResolveAllBitmapsLinks Embeds all externally linked bitmaps
RestoreSettings Restores a specific internally saved document setting
Revert Reverts all changes made to the document since the last save
SampleColorAtPoint Samples a color at a point
SampleColorInArea Samples the average colors within an area
Save Saves the document
SaveAs Lets you save the document to a different file and specify additional options through the StructSaveAsOptions object
SaveAsCopy Saves the document to a new file but doesn't keep the link to it
SaveSettings Saves document settings that can be recalled later, including Unit, Drawing Origin, curve Precision, Reference Point, PreserveSelection, ShapeEnumdirection, and Apply To Duplicate
SaveStyleSheet Saves styles in the current document as a template
SaveStyleSheetAsDefault Saves styles in the current document as a default template to be used with all new documents
Selection Returns a shape with a cdrSelectionShape type
SetLayout Sets a different layout type for the document
ShowAllHiddenObjects Shows all hidden objects in the document
ToUnits Converts a given value from specified units into the current document units
UnadviseEvents Unadvise document events
Undo Reverses the last operation
Events:
Name Description
AfterExport Invoked after exporting the document
AfterPrint Invoked after printing the document
AfterSave Invoked after saving the document
BeforeExport Invoked before exporting the document
BeforePrint Invoked before printing the document
BeforeSave Invoked before saving the document
Close Invoked when the document is closed
LayerActivate Invoked when a layer is activated
LayerChange Invoked when a layer is changed
LayerCreate Invoked when a layer is created
LayerDelete Invoked when a layer is deleted
Open Invoked when the document is opened
PageActivate Invoked when a page is activated
PageChange Invoked when a page is changed
PageCreate Invoked when a page is created
PageDelete Invoked when a page is deleted
QueryClose Invoked when the user responds to a request to close the document
QueryExport Invoked when the user responds to a request to export the document
QueryPrint Invoked when the user responds to a request to print the document
QuerySave Invoked when the user responds to a request to save the document
SelectionChange Invoked when a selection is changed
ShapeChange Invoked when a shape is changed
ShapeCreate Invoked when a shape is created
ShapeDelete Invoked when a shape is deleted
ShapeDistort Invoked when a shape is distorted
ShapeMove Invoked when a shape is moved
ShapeTransform Invoked when a shape is transformed