PowerPoint.HyperlinkAddOptions interface

Représente les options disponibles lors de l’ajout d’un fichier PowerPoint.Hyperlink.

Remarques

Ensemble d’API : PowerPointApi 1.10

Utilisateur

Exemples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/hyperlinks/manage-hyperlinks.yaml

// Sets a hyperlink on the selected text range.
await PowerPoint.run(async (context) => {
  const slide: PowerPoint.Slide = context.presentation.getSelectedSlides().getItemAt(0);
  const textRange: PowerPoint.TextRange = context.presentation.getSelectedTextRange().load("text");
  const hyperlinks: PowerPoint.HyperlinkCollection = slide.hyperlinks;
  const hyperlinkAddOptions: PowerPoint.HyperlinkAddOptions = {
    address: "https://bing.com",
    screenTip: "Screen tip for text",
  };
  let hyperlink: PowerPoint.Hyperlink = hyperlinks.add(textRange, hyperlinkAddOptions).load("address,screenTip");
  try {
    await context.sync();
  } catch {
    console.warn(
      "Confirm that you have at least one slide and you've selected a contiguous range of text on the active slide.",
    );
    return;
  }

  console.log(
    `Added link "${hyperlink.address}" (screen tip: "${hyperlink.screenTip}") to the selected text "${textRange.text}".`,
  );
});

Propriétés

address

Spécifie l’adresse du lien hypertexte, qui peut être une URL, un nom de fichier ou un chemin d’accès de fichier, ou une adresse e-mail avec le schéma d’URI mailto .

screenTip

Spécifie la chaîne affichée lorsque vous pointez sur le lien hypertexte.

Détails de la propriété

address

Spécifie l’adresse du lien hypertexte, qui peut être une URL, un nom de fichier ou un chemin d’accès de fichier, ou une adresse e-mail avec le schéma d’URI mailto .

address?: string;

Valeur de propriété

string

Remarques

Ensemble d’API : PowerPointApi 1.10

screenTip

Spécifie la chaîne affichée lorsque vous pointez sur le lien hypertexte.

screenTip?: string;

Valeur de propriété

string

Remarques

Ensemble d’API : PowerPointApi 1.10