Lock or Password Protect ODP using C++

Use Aspose.Slides for C++ to encrypt presentations and set write protection without Microsoft PowerPoint.

Protecting an ODP Presentation via C++

Aspose.Slides for C++ lets you protect ODP presentations from opening or modification. Use the ProtectionManager object from the Presentation class to encrypt a file with Encrypt or restrict editing with SetWriteProtection.

Encrypting an ODP Presentation using C++

auto presentation = MakeObject<Presentation>(u"presentation.odp");

presentation->get_ProtectionManager()->Encrypt(u"password");
presentation->Save(u"encrypted-presentation.odp", SaveFormat::Odp);
presentation->Dispose();

Setting Write Protection to an ODP Presentation using C++

auto presentation = MakeObject<Presentation>(u"presentation.odp");

presentation->get_ProtectionManager()->SetWriteProtection(u"password");
presentation->Save(u"write-protected-presentation.odp", SaveFormat::Odp);
presentation->Dispose();

How to Password Protect ODP via C++

Follow these steps to protect an ODP presentation.

  1. Load the ODP file with the Presentation class.
  2. Protect the presentation with the ProtectionManager object.
  3. Use Encrypt for password protection or SetWriteProtection for write protection.
  4. Save the protected file with SaveFormat::Odp.

Built with Aspose.Slides

Password-Protect ODP Files Online

The free Aspose.Slides Lock app is built with Aspose.Slides for C++, the same API as the code above. Open it and see what the API can do with your own ODP files.

  • Runs in your browser, nothing to install.
  • See how Aspose.Slides protects presentations before you write code.
  • Set a password to open or edit your ODP file.
  • Download the protected file.

Other Supported Protection Formats

Using C++, you can also protect the following formats.