Previous Document Next Document

Object Model Reference : Classes : D : Document : Methods : Document.Export


Document.Export

Sub Export(FileName As String, Filter As cdrFilter, [Range As cdrExportRange = cdrCurrentPage], [Options As StructExportOptions], [PaletteOptions As StructPaletteOptions])

Description

Member of Document

The Export method exports graphics to a file.

Parameter
Description
FileName
Specifies the name of the document to export
Filter
Specifies the filter that is used when exporting objects
Range
Specifies the pages to export from the document: all or several pages, a single page, or a selection of objects. This parameter is optional, and its default value is cdrCurrentPage (1).
Options
Specifies the Save options of the document. This parameter is optional, and its default value is 0.
PaletteOptions
Specifies the set of options when exporting to a paletted bitmap. This parameter is optional, and its default value is Nothing.

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.