HotXLS-documentatie

SaveAs methode

Slaat het werkblad op in een bestand of stream. Retourneert 1 bij succes

Syntaxis

functie SaveAs(FileName: WideString; FileFormat: TXLSFileFormat): Integer;
functie SaveAs(Stream: TStream; FileFormat: TXLSFileFormat): Integer;
FileName WideString. Een tekenreeks die de naam van het op te slaan bestand aangeeft. Je kunt een volledig pad opnemen; doe je dat niet, dan slaat de component het bestand op in de huidige map
FileFormat TXLSFileFormat. A value that indicates format of the file to be saved
Stream TStream. Saves to a stream specified in the Stream parameter

Beschrijving

FileFormat can be one of these TXLSFileFormat constants
xlRTF RTF file format
xlHTML HTML file format
xlCSV Bestandsformaat met door komma's gescheiden waarden (CSV)
xlText Bestandsformaat met door tabs gescheiden waarden (TSV)
xlUnicodeCSV Bestandsformaat met door komma's gescheiden unicode-waarden (CSV)
xlUnicodeText Bestandsformaat met door tabs gescheiden unicode-waarden (TSV)

Voorbeeld

This example saves the Worksheet one as CSV file

Workbook.Sheets[1].SaveAs('sheet.csv', xlCSV);
This example saves the Worksheet one as RTF file

Workbook.Sheets[1].SaveAs('sheet.rtf', xlRTF);
This example saves the Worksheet one as HTML file

Workbook.Sheets[1].SaveAs('sheet.html', xlHTML);
This example saves the Worksheet one as TSV file

Workbook.Sheets[1].SaveAs('sheet.tsv', xlText);
Dit voorbeeld slaat werkblad één op als unicode-TSV-bestand

Workbook.Sheets[1].SaveAs('sheet.tsv', xlUnicodeText);
Dit voorbeeld slaat werkblad één op als unicode-CSV-bestand

Workbook.Sheets[1].SaveAs('sheet.csv', xlUnicodeCSV);