เอกสาร HotXLS

AddHyperlink เมธอด

Adds a hyperlink to one เวิร์กชีต เซลล์ by coordinates or A1-style reference and writes the display text to that เซลล์

ไวยากรณ์

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;
    

พารามิเตอร์

Row, Col 1-based เวิร์กชีต coordinates of the target เซลล์
ARange A1-style target เซลล์ reference
Address URL, ไฟล์ address, or เวิร์กบุ๊ก 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

ตัวอย่าง

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');
    

ดูเพิ่มเติม

TXLSWorksheet คลาส
TXLSWorksheet.Hyperlinks คุณสมบัติ
IXLSHyperLinks.Add เมธอด