次の方法で共有


PowerPoint.HyperlinkAddOptions interface

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

注釈

[ API set: 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 set: PowerPointApi 1.10 ]

screenTip

ハイパーリンクの上にマウス ポインターを置いたときに表示される文字列を指定します。

screenTip?: string;

プロパティ値

string

注釈

[ API set: PowerPointApi 1.10 ]