How to Protect PPTX Presentation Using C++

This topic shows, how to protect PPTX Presentation using C++ by setting a password for encryption. There are different ways one can secure the PowerPoint presentation like by applying a textual or image watermark or making it read only. In this tutorial, we’ll be programmatically setting password for protecting presentation using C++.

Steps to Lock PowerPoint Presentation in C++

  1. Use Aspose.Slides for C++ NuGet package
  2. Add reference to Aspose::Slides and Export namespaces
  3. Load the presentation file for protection using Presentation class instance
  4. Use Encrypt method exposed by ProtectionManager class to secure presentation with a password
  5. Save the password protected presentation using Save method and saving as PPTX

The Aspose.Slides for C++ API can help you to secure PowerPoint presentation using C++ without any reliance on Microsoft Interop or even Microsoft PowerPoint being installed on your machine.

Code to Lock PowerPoint Presentation in C++

Earlier, in another how-to topic, we have looked How to Insert Draft Watermark in PowerPoint Presentation in C#. But in the above example we have seen how to secure PPTX presentation in C++. The API also have provision to unlock the protection on presentation by removing password in C++ as well. There are few lines of code in C++ allowing you to secure your presentation.

 English