API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.ExportEx method
Exports a document to a supported non-native file format and returns an instance of ExportFilter
Syntax:
Function ExportEx(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) As ExportFilter
Parameters:
Name Type Description
FileName
String
Filter
Range
Specifies the pages that are exported, accepting a value of cdrExportRange.
Options
Specifies the Save options of the exported document.
PaletteOptions
Specifies the set of options to apply when exporting to a paletted bitmap.
Remarks:
The ExportEx method exports a document, with specified options, to another file format, and returns an ExportFilter object. This function uses the StructExportOptions and StructPaletteOptions objects to specify image conversion and export parameters. The ExportEx method returns an ExportFilter object that should be used to set additional filter parameters (such as JPEG compression, GIF transparent color, and so on) and finish the export.
Examples:
The following VBA example exports the newly created document to GIF format, allowing the user to set GIF properties and ensure that the image is interlaced.
Sub Test()
Dim d As Document
Dim s As Shape
Dim opt As New StructExportOptions
Dim pal As New StructPaletteOptions
Dim Filter As ExportFilter
Set d = CreateDocument
Set s = d.ActiveLayer.CreateEllipse2(4, 5, 2)
s.Fill.ApplyFountainFill CreateRGBColor(255, 0, 0), CreateRGBColor(0, 0, 0)
opt.AntiAliasingType = cdrNormalAntiAliasing
opt.ImageType = cdrRGBColorImage
opt.ResolutionX = 72
opt.ResolutionY = 72
pal.PaletteType = cdrPaletteOptimized
pal.NumColors = 16
pal.DitherType = cdrDitherNone
Set Filter = d.ExportEx("C:\Temp\Doc.gif", cdrGIF, cdrCurrentPage, opt, pal)
If Filter.ShowDialog() Then
  If Not Filter.Interlaced Then

 MsgBox "Interlaced is not specified... Fixing this."

 Filter.Interlaced = True
  End If
  Filter.Finish
Else
  MsgBox "Export canceled"
End If 
End Sub