Object Model Reference : Classes : D : Document : Methods : Document.ExportEx |
Function ExportEx(FileName As String, Filter As cdrFilter, [Range As cdrExportRange = cdrCurrentPage], [Options As StructExportOptions], [PaletteOptions As StructPaletteOptions]) As ExportFilter
Member of Document
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.
Parameter
|
Description
|
FileName
|
Specifies the name of the document you are saving
|
Filter
|
Specifies the filter that is used when saving objects, accepting a value of cdrFilter.
|
Range
|
Specifies the pages that are exported, accepting a value of cdrExportRange. This parameter is optional, and its default value is cdrCurrentPage (1).
|
Options
|
Specifies the Save options of the exported document. This parameter is optional, and its default value is Nothing.
|
PaletteOptions
|
Specifies the set of options to apply when exporting to a paletted bitmap. This parameter is optional, and its default value is Nothing.
|
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 |
Copyright 2013 Corel Corporation. All rights reserved.