Documentación HotXLS

Clases TXLSXRichText y TXLSXRichTextRun

TXLSXRichText almacena segmentos de texto con estilo para TXLSXCell.RichText y texto enriquecido de comentarios en la fachada XLSX

Declaraciones

type
  TXLSXRichText = class
    function AddRun: TXLSXRichTextRun;
    function AddRunText(const AText: WideString): TXLSXRichTextRun;
    procedure Clear;
    function PlainText: WideString;
    property RunCount: Integer;
    property Runs[Index: Integer]: TXLSXRichTextRun;
  end;

  TXLSXRichTextRun = class
    property Text, Name: WideString;
    property Size: Double;
    property Bold, Italic, Strikethrough, ColorIsAuto: Boolean;
    property Underline: TXLSXUnderline;
    property Color: LongWord;
    property VertAlign: TXLSXFontVertAlign;
  end;

Miembros principales

AddRun and AddRunTextAñade un segmento vacío o un segmento con texto inicial
PlainTextDevuelve el texto concatenado sin información de estilo
Name, Size, Bold, Italic and StrikethroughFamilia de fuente, tamaño y atributos de estilo básicos de un segmento
Underline, Color and ColorIsAutoOpciones de subrayado y color del segmento
VertAlignAlineación vertical de línea base, subíndice o superíndice

Ejemplo

var Rich: TXLSXRichText;
begin
  Rich := TXLSXRichText.Create;
  Rich.AddRunText('Quarterly ');
  Rich.AddRunText('Report').Bold := True;
  Sheet.Cells[1, 1].RichText := Rich;
end;

Véase también