ExcelScript.RangeHyperlink interface

Representa las cadenas necesarias para obtener o establecer un objeto de hipervínculo (XHL).

Comentarios

Ejemplos

/**
 * 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();
}

Propiedades

address

Representa el destino de dirección URL del hipervínculo.

documentReference

Representa el destino de referencia del documento para el hipervínculo.

screenTip

Representa la cadena que se muestra al mantener el puntero sobre el hipervínculo.

textToDisplay

Representa la cadena que se muestra en la celda superior izquierda del rango.

Detalles de las propiedades

Representa el destino de dirección URL del hipervínculo.

address?: string;

Valor de propiedad

string

Representa el destino de referencia del documento para el hipervínculo.

documentReference?: string;

Valor de propiedad

string

Ejemplos

/**
 * 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)
}

Representa la cadena que se muestra al mantener el puntero sobre el hipervínculo.

screenTip?: string;

Valor de propiedad

string

Representa la cadena que se muestra en la celda superior izquierda del rango.

textToDisplay?: string;

Valor de propiedad

string