Tài liệu HotXLS

AddHyperlink phương thức

Adds a hyperlink to one trang tính ô by coordinates or A1-style reference and writes the display text to that ô

Cú pháp

function AddHyperlink(Row, Col: Integer; Address: WideString): IXLSHyperLink; overload;
function AddHyperlink(ARange: WideString; Address: WideString): IXLSHyperLink; overload;
function AddHyperlink(Row, Col: Integer; Address: WideString; TextToDisplay: WideString): IXLSHyperLink; overload;
function AddHyperlink(ARange: WideString; Address: WideString; TextToDisplay: WideString): IXLSHyperLink; overload;
function AddHyperlink(Row, Col: Integer; Address: WideString; TextToDisplay: WideString; ScreenTip: WideString): IXLSHyperLink; overload;
function AddHyperlink(ARange: WideString; Address: WideString; TextToDisplay: WideString; ScreenTip: WideString): IXLSHyperLink; overload;
    

Tham số

Row, Col 1-based trang tính coordinates of the target ô
ARange A1-style target ô reference
Address URL, tệp address, or sổ làm việc target for the hyperlink
TextToDisplay Text written to the target ô and stored as the hyperlink display text. If omitted or empty, the address is used
ScreenTip Optional tooltip shown by spreadsheet applications

Ví dụ

Workbook.Sheets[1].AddHyperlink(
  1, 2,
  'https://www.loslab.com',
  'Visit losLab',
  'Open site');

Workbook.Sheets[1].AddHyperlink(
  'C4',
  'www.loslab.com/docs',
  'Read docs',
  'Open documentation');
    

Xem thêm

TXLSWorksheet lớp
TXLSWorksheet.Hyperlinks thuộc tính
IXLSHyperLinks.Add phương thức