Previous Document Next Document
Document.Export

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

Member of Document

The Export method exports graphics to a file.

Parameters
Description
FileName
Specifies the string value that names the document you are exporting
Filter
Specifies the filter that is used when exporting objects
Range
Specifies the pages that are exported. You have the option of exporting all or several pages in a document, a single page in a document, or a selection of objects within a document.
This parameter is optional, and its default value is cdrCurrentPage (1).
Options
Identifies 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.

The following code 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 2007 Corel Corporation. All rights reserved.