API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.Export method
Exports a document to a supported non-native file format
Syntax:
Sub Export(ByVal FileName As String, ByVal Filter As cdrFilter, Optional ByVal Range As cdrExportRange = cdrCurrentPage, Optional ByVal Options As StructExportOptions = Nothing, Optional ByVal PaletteOptions As StructPaletteOptions = Nothing)
Parameters:
Name Type Description
FileName
String
Filter
Range
Specifies the pages to export from the document: all or several pages, a single page, or a selection of objects.
Options
Specifies the Save options of the document.
PaletteOptions
Specifies the set of options when exporting to a paletted bitmap.
Remarks:
The Export method exports graphics to a file.
Examples:
The following VBA example creates a rectangle with fountain fill and exports it to a JPEG file:
Sub Test()
Dim opt As New StructExportOptions
Dim s As Shape
ActiveDocument.Unit = cdrInch
Set s = ActiveLayer.CreateRectangle(0, 0, 1, 1)
s.Fill.ApplyFountainFill CreateColorEx(5005, 255, 0, 0), _
  CreateColorEx(5005, 0, 0, 0)
opt.AntiAliasingType = cdrNormalAntiAliasing
opt.ImageType = cdrRGBColorImage
opt.Overwrite = True
opt.ResolutionX = 72
opt.ResolutionY = 72
opt.SizeX = opt.ResolutionX * s.SizeWidth
opt.SizeY = opt.ResolutionY * s.SizeHeight
ActiveDocument.Export "C:\Rect.jpg", cdrJPEG, cdrSelection, opt 
End Sub