method View.Export ([Destination as Variant], [Options as Variant])
Exports the control's data to a CSV format.

TypeDescription
Destination as Variant A String expression that specifies the file/format to be created. The Destination parameter indicates the format to be created as follows:
  • "array" indicates that the Export method returns the control's data as a two-dimensional array
  • if "htm" or "html", the control returns the HTML format ( including CSS style )
  • Any file-name that ends on ".htm" or ".html" creates the file with the HTML format inside
  • missing, empty, or any other case the Export exports the control's data in CSV format.

No error occurs, if the Export method can not create the file.

Options as Variant A String expression that specifies the options to be used when exporting the control's data, as explained bellow. 
ReturnDescription
VariantThe result of the Export method is a:
  • two-dimensional array, if the Destination is "array". For instance Export("array","vis") method exports the control's data as it is displayed into a two-dimensional array (zero-based). The result includes the columns headers into the first line, while the rest of lines contains the control's visible data. For instance, Export("array", "vis")(1, 5) returns the value of the cell on the second column and fifth row.
  • string, that indicates the format being exported. It could be CSV or HTML format based on the Destination parameter
The Export method can export the control's DATA to a CSV or HTML format. The Export method can export a collection of columns from selected, visible, check or all items. By default, the control export all items, unless there is no filter applied on the control, where only visible items are exported. No visual appearance is saved in CSV format, instead the HTML format includes the visual appearance in CSS style. The Export method can export a collection of columns from selected, visible, check or all items. 

The Options parameter consists a list of fields separated by | character, in the following order:

  1. The first field could be all, vis, sel or chk, to export all, just visible, selected or checked items. The all option is used, if the field is missing. The all option displays all items, including the hidden or collapsed items. The vis option includes the visible items only, not including the child items of a collapsed item, or not-visible items ( item's height is 0 ). The sel options lists the items being selected. The chk option lists all check and visible items. If chk option is used, the first column in the columns list should indicate the index of the column being queried for a check box state. The CellState property indicates the state of the cell's checkbox.
  2. the second field indicates the column to be exported. All visible columns are exported, if missing. The list of columns is separated by , character, and indicates the index of the column to be shown on the exported data. The first column in the list indicates the column being queried, if the option chk is used. 
  3. the third field indicates the character to separate the fields inside each exported line [tab character-if missing]. 
  4. the forth field could be ansi or unicode, which indicates the format to save the control's content to Destination. If missing, the control's configuration specifies the way the control's content is serialized, such as the ANSI version saves as ANSI, while the UNICODE version will export the control's data in UNICODE format. The Version property specifies the version of the control, and if this includes the UNICODE string, it indicates that you are running the UNICODE version of the control. For instance, Export( Destination,"|||ansi" ) saves the control's content to destination in ANSI format. 

The Destination parameter indicates the file to be created where exported date should be saved. For instance, Export( Destination,"sel|0,1|;") exports the cells from columns 0, 1 from the selected items, to a CSV using the ; character as a field separator. If Destination is empty or missing, the Export returns the result as a string.

The "CSV" refers to any file that:

You can use the CopyTo to export the control's view to clipboard/EMF file.