HotXLS 开发者参考:TXLSXRichText 和 TXLSXRichTextRun 类

提供此 XLSX 功能的 API,并保留原始标识符

TXLSXRichText 提供此 XLSX 功能的 API,并保留原始标识符 TXLSXCell.RichText 提供此 XLSX 功能的 API,并保留原始标识符

主要成员

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;

主要成员

AddRun and AddRunText主要成员
PlainText使用属性和方法创建、读取和更新工作表、区域与对象
Name, Size, Bold, Italic and Strikethrough使用属性和方法创建、读取和更新工作表、区域与对象
Underline, Color and ColorIsAuto另请参阅
VertAlignTXLSXWorkbook

TXLSXWorksheet

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

TXLSXWorksheet