Saves Worksheet in RTF file. Returns 1 if it succeeds.
Remarks
Syntax
function SaveAsRTF(FileName: WideString): Integer;
function SaveAsRTF(Stream: TStream): Integer;
FileName |
WideString. A string that indicates the name of the file to be saved. You can include a full path; if you don't, Worksheet saves the file in the current folder. |
Stream |
TStream. Saves Worksheet to a stream specified in the Stream parameter. |
Example
This example creates a new workheet and then saves it in the RTF file.
Var
Book: IXLSWorkbook;
Sheet: IXLSWorksheet;
begin
Book := TXLSWorkbook.Create; {create new Workbook}
Sheet := Book.Worksheets.Add;
With Sheet.Cells[2,2] do
begin
Value := 'Text value';
Font.Size := 20;
Font.Color := clRed;
ColumnWidth := 50;
end;
Sheet.SaveAsRTF('sheet.rtf');
end;