次の方法で共有


ExcelScript.RangeHyperlink interface

ハイパーリンク (XHL) オブジェクトを取得または設定するために必要な文字列を表します。

注釈

/**
 * This script puts a link to a webpage in a cell.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the first cell in the current worksheet.
  const cell = workbook.getActiveWorksheet().getCell(0,0);

  // Create a link to a webpage.
  const sampleHyperlink : ExcelScript.RangeHyperlink = {
    address: "https://learn.microsoft.com/office/dev/scripts/resources/samples/table-of-contents",
    screenTip: "Sample: Create a workbook table of contents",
    textToDisplay: "Learn how to make a workbook table of contents"
  }

  // Put the link in the cell and format the width to fit.
  cell.setHyperlink(sampleHyperlink);
  cell.getFormat().autofitColumns();
}

プロパティ

address

ハイパーリンクの URL ターゲットを表します。

documentReference

ハイパーリンクのドキュメント参照先を表します。

screenTip

ハイパーリンクの上にカーソルを合わせると表示される文字列を表します。

textToDisplay

該当する範囲内の左上端のセルに表示される文字列を表します。

プロパティの詳細

ハイパーリンクの URL ターゲットを表します。

address?: string;

プロパティ値

string

ハイパーリンクのドキュメント参照先を表します。

documentReference?: string;

プロパティ値

string

/**
 * This script creates a hyperlink in the current cell to a table.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the selected cell.
  const selectedCell = workbook.getActiveCell();

  // Create a hyperlink from the current cell to a table named "Resources".
  const link : ExcelScript.RangeHyperlink = {
    documentReference: "Resources",
    screenTip: "Resources table",
    textToDisplay: "Go to table"
  } ;

  selectedCell.setHyperlink(link)
}

ハイパーリンクの上にカーソルを合わせると表示される文字列を表します。

screenTip?: string;

プロパティ値

string

該当する範囲内の左上端のセルに表示される文字列を表します。

textToDisplay?: string;

プロパティ値

string