PowerPoint.HyperlinkAddOptions interface

PowerPoint.Hyperlink を追加するときに使用できるオプションを表します。

注釈

API セット: PowerPointApi 1.10

使用元

// 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}".`,
  );
});

プロパティ

address

ハイパーリンクのアドレス (URL、ファイル名、ファイル パス、または mailto URI スキームを持つ電子メール アドレス) を指定します。

screenTip

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

プロパティの詳細

address

ハイパーリンクのアドレス (URL、ファイル名、ファイル パス、または mailto URI スキームを持つ電子メール アドレス) を指定します。

address?: string;

プロパティ値

string

注釈

API セット: PowerPointApi 1.10

screenTip

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

screenTip?: string;

プロパティ値

string

注釈

API セット: PowerPointApi 1.10