breslav's avatar
breslav
Copper 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

  • macg's avatar
    macg
    Occasional Reader

    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

    • breslav's avatar
      breslav
      Copper 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
      Copper 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