breslav's avatar
breslav
Brass Contributor
Jan 10, 2025
Status:
New

Add Method to Create Hyperlinks in PowerPoint JavaScript API

I am writing to request the addition of a method in the PowerPoint JavaScript API that allows developers to programmatically convert text into hyperlinks. Currently, this functionality is available in the Word JavaScript API, where the Range.hyperlink property can be used to set a hyperlink on a range of text. However, a similar capability does not exist in the PowerPoint JavaScript API.

At present, the only ways to create hyperlinks in PowerPoint are through the user interface or by using VSTO add-ins. These methods are not ideal for developers who wish to automate the process within web and Mac add-ins. 

Implementing a method to set hyperlinks on text within the PowerPoint JavaScript API would greatly enhance its functionality and bring it closer to parity with the Word JavaScript API. This addition would be beneficial for developers seeking to create more robust and feature-rich PowerPoint add-ins.

Thank you for considering this feature request. I believe it would be a valuable enhancement to the Office.js library and look forward to any updates on this matter.

Sincerely,
Simon Breslav

12 Comments

  • Sherlockbin's avatar
    Sherlockbin
    Copper Contributor

     

    Thanks for pushing this. The newer hyperlink work in requirement sets (1.6 and now 1.10) is a step forward, but there is still a major gap that blocks real PowerPoint automation: creating internal slide-to-slide links.

     

    Today we can set a hyperlink address and screen tip, which is fine for external URLs. What we cannot do is create the native PowerPoint “jump to slide” hyperlink that PowerPoint stores as ppaction://hlinksldjump and ties to a relationship for a slide target (the equivalent of SubAddress in COM/VBA). That missing capability prevents a lot of common scenarios:

     

    • Building an automated table of contents or agenda where each entry jumps to the right slide
    • Creating in-slide navigation bars (tabs) for long client reports
    • Validating and repairing internal links after slides are inserted, deleted, or reordered
    • Ensuring those internal links survive “Save As PDF” so the navigation works in the distributed PDF

     

     

    Without internal targets, the workarounds are ugly: VBA-only tooling, VSTO/COM-only authoring, or worst of all, server-side Open XML rewriting of the PPTX package and re-uploading to SharePoint, which is risky during coauthoring because it can overwrite live edits and disrupt AutoSave.

     

    Feature request: please extend PowerPoint hyperlinks to support internal targets in a first-class way, either:

     

    • subAddress (read/write) similar to other Office hosts, or
    • a dedicated API like setHyperlink({ targetSlideId: ... }) / linkToSlide(slideId) that is stable even when slide order changes.

     

     

    That one addition would unlock ToC automation, nav bars, and reliable PDF navigation without forcing customers into unsafe file rewrite workflows. 

  • colecdc's avatar
    colecdc
    Copper Contributor

    I too would find use in this. I just made a useful took to automate ToC creafion, but I can't automatically link the ToC entries to their respective slides. Workaround is having a VBA macro go back through the ToCs and link using the shown page number. I could rework this all in VBA, but JS for Office is more elegant :)

  • macg's avatar
    macg
    Copper Contributor

    And can we use this opportunity to finally format hyperlinks as desired (i.e., without underlines)?

  • Hi breslav - we recently released the ability to work with hyperlinks in Requirement Set 1.6. Please try it out!

     

    https://learn.microsoft.com/en-us/javascript/api/requirement-sets/powerpoint/powerpoint-api-1-6-requirement-set?view=powerpoint-js-preview

    • abhitesh9319's avatar
      abhitesh9319
      Copper Contributor

      Hi EsterB​  , The current PowerPoint JavaScript API only supports address and screenTip parameters for adding hyperlinks. There is no support for internal slide-to-slide hyperlinks. In COM-based APIs, this is achieved using a SubAddress parameter. Adding similar support (for example, a subAddress field) to the JS API would enable internal slide hyperlinks and be very helpful.

    • breslav's avatar
      breslav
      Brass Contributor

      Hi EsterB, as Codispoto points out, the API is only for reading links from the slide, not adding links to the slide. 

    • Codispoto's avatar
      Codispoto
      Copper Contributor

      Hi EsterB,

      With the documentation you shared, it seems that we can only load the hyperlinks that are already on the slide, but we can't create new ones—is that correct? I've tried adding a hyperlink using the Office API with JavaScript, but I haven't been able to make it work.

      Thanks!

  • Codispoto's avatar
    Codispoto
    Copper Contributor

    Dear Simon Breslav,

    I completely agree with you.
    This is an essential feature for building more robust PowerPoint add-ins. I am facing the same issue; I would like to add attributions to images I insert into slides, but there is currently no way to link them to a hyperlink, add alternative text, or include a comment. These functionalities are already available in Excel and Word, yet they are missing from PowerPoint.

    Adding support for setting hyperlinks on text and images in the PowerPoint JavaScript API would be a significant improvement, making it much more capable and aligned with the other Office applications.

    Thank you for raising this request, and I truly hope Microsoft considers implementing it.

    Best regards,
    Mariangeles Codispoto.

  • I haven't tried this, but you may be able to use Script Editor.app on your Mac to get at the Hyperlink capabilities. You can set Script Editor to Javascript in Script Editor settings.

    • breslav's avatar
      breslav
      Brass Contributor

      Hi JimGMac, thank you for suggestion, I'm sure it's possible to automate these kinds of things using external tools that are not inside of Powerpoint JS add-in sandbox, but my goal is not just to automate this for my self, my goal is to build an Add-in for PowerPoint using PowerPoint JavaScript API. Thus, I'm hoping that someone from Microsoft will see this, and will add this feature to their roadmap.

      Thanks,

      Simon