Add or Remove Hyperlinks from PowerPoint PPT in C#

Hyperlinks in documents are used to navigate from one location to another. Generally, in PowerPoint presentations, they are used to insert URLs of webpages. You can create a hyperlink of text, image, shape, or a media element in PowerPoint PPT slides. In this article, you will learn how to add hyperlinks to PowerPoint PPT in C#. Moreover, we will cover how to remove hyperlinks from PPT slides programmatically.

To work with hyperlinks in PowerPoint presentations, we will use Aspose.Slides for .NET. It is a popular API that is used to create and modify PPT/PPTX presentations. Moreover, it lets you convert the presentations to other popular formats. You can download its DLL or install it from NuGet.

PM> Install-Package Aspose.Slides.NET 

You can add different types of hyperlinks in PowerPoint presentations using Aspose.Slides for .NET. The hyperlink could be a text, image, shape, audio, or video element. In the following sections, we will cover how to add all these hyperlinks in a PPT/PPTX presentation.

The following are the steps to add a text hyperlink in a PowerPoint PPT/PPTX in C#.

The following code sample shows how to add a text hyperlink in a PowerPoint PPTX using C#.

The following steps demonstrate how to insert a shape hyperlink in a PowerPoint presentation in C#.

The following code sample shows how to create a hyperlink of shape in PowerPoint using C#.

The following are the steps to insert an image hyperlink in a PowerPoint PPT in C#.

The following code sample shows how to create a hyperlink of an image in PowerPoint using C#.

You can add an audio hyperlink to a PowerPoint PPT/PPTX by following the steps below:

The following code snippet demonstrates how to add an audio hyperlink in PowerPoint in C#:

To add a video hyperlink to a PowerPoint PPT/PPTX, follow the steps below:

The following code snippet demonstrates how to add a video hyperlink in PowerPoint in C#:

In this section, we will demonstrate how to remove hyperlinks from a PowerPoint slide. These hyperlinks could be of any type we have discussed above. The following are the steps to perform this operation.

The following code sample shows how to remove hyperlinks from a slide in PowerPoint PPT in C#.

C# PowerPoint API - Get a Free License

You can work with hyperlinks in PowerPoint presentations without evaluation limitations by getting a free temporary license.

Conclusion

In this article, you have learned how to add or remove hyperlinks in PowerPoint PPT in C#. Moreover, we have covered how to make hyperlinks of text, image, shape, audio, and video elements. Besides, you can explore more about Aspose.Slides for .NET by visiting the documentation. Also, you can post your queries to our forum.

See Also