Export2 - Automation
The Export2 method exports the document to a specified graphics file. Returns a Boolean. It returns 'True', if the file is exported successfully, otherwise it returns 'False'.
Export2 is a complete replacement for Export. It is recommended for use in new scripts.
Syntax
object. Export2( FileName, SelectionOnly, Options, FilterId)
Parameter |
Type |
Required/ Option |
Default |
Description |
FileName |
String |
Required |
|
This provides the path and file name of the file to be exported. |
SelectionOnly |
Boolean |
Optional |
False |
This specifies whether to export selected objects, or the entire plot. |
Options |
Optional |
"" |
See the Export Filter ID and Options page for the export options available for specific formats. |
|
FilterId |
Optional |
"" |
FilterId specifies the file format extension if the extension entered for FileName is unknown. See the Export Filter ID and Options page for the export options available for specific formats. |
Remarks
1. FilterId is required if no recognized file extension is used in FileName, or if the file extension supplied can be used by more than one file format.
2. FilterId is case-sensitive. File extensions are case-insensitive.
3. If FilterId is used the file extension is optional.
4. Since the Export Options dialog is not displayed when the program is driven from an automation script, an options string can be specified in the script.
5. The following table shows two common export options. These options apply to all filters. See Export FilterID for all options.
Option |
Action |
Default |
Description |
Defaults |
0 = No, use previously saved options 1 = Yes, set all options to defaults |
0 |
Set all options to their default values. Any additional options specified in the option string are applied after the previously saved or default values are set. |
ForgetOptions |
0 = No, save the options for later use 1 = Yes, don't save options for later use |
0 |
Don't remember options for later use. If set to 0, any previously saved options are overwritten with any new values specified in the option string. |
Example 1
This example demonstrates how to export a plot document as a .TIF using bitmap export options.
Plot.Export2(FileName:= SurferApp.Path+"\Samples\demogrid.tif", _
SelectionOnly:=False, Options:="Width=717, Height=949, KeepAspect=0", _
FilterId:="tif")
Example 2
This script displays all the methods and properties in the PlotDocument object.
Used by: PlotDocument object