NativeExcel suite v1.x

SaveAsRTF method

Saves worksheet in RTF file. Returns 1 if it succeeds.

Remarks

This method is deprecated. Use IXLSWorksheet.SaveAs method.

Syntax

function SaveAsRTF(FileName: WideString): integer;
function SaveAsRTF(Stream: TStream): integer;
FileNameWideString. 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.
StreamTStream. 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;
Copyright © NikaSoft 2004-2010