Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
PowerPoint.HyperlinkAddOptions interface
- Package:
- powerpoint
Represents the available options when adding a PowerPoint.Hyperlink.
Remarks
Used by
- PowerPoint.HyperlinkCollection: add
- PowerPoint.Shape: setHyperlink
- PowerPoint.TextRange: setHyperlink
Examples
// 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}".`,
);
});
Properties
| address | Specifies the address of the hyperlink, which can be a URL, a file name or file path, or an email address with the |
| screenTip | Specifies the string displayed when hovering over the hyperlink. |
Property Details
address
Specifies the address of the hyperlink, which can be a URL, a file name or file path, or an email address with the mailto URI scheme.
address?: string;
Property Value
string
Remarks
screenTip
Specifies the string displayed when hovering over the hyperlink.
screenTip?: string;
Property Value
string
Remarks
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
