# Protect PPTX Presentations using C++

> Protect PPTX presentations in C++. Use Aspose.Slides for C++ to encrypt files and set write protection.

Source: https://products.aspose.com/slides/cpp/protect/pptx/
Updated: 2026-07-09



## Protecting a PPTX Presentation via C++

Aspose.Slides for C++ lets you protect PPTX 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 a PPTX Presentation using C++

```cpp
auto presentation = MakeObject<Presentation>(u"presentation.pptx");

presentation->get_ProtectionManager()->Encrypt(u"password");
presentation->Save(u"encrypted-presentation.pptx", SaveFormat::Pptx);
presentation->Dispose();
```

### Setting Write Protection to a PPTX Presentation using C++

```cpp
auto presentation = MakeObject<Presentation>(u"presentation.pptx");

presentation->get_ProtectionManager()->SetWriteProtection(u"password");
presentation->Save(u"write-protected-presentation.pptx", SaveFormat::Pptx);
presentation->Dispose();
```

## How to Password Protect PPTX via C++

These are the steps to protect PPTX files.

Load the PPTX file with the `Presentation` class.

Protect the presentation with the `ProtectionManager` object.

Use `Encrypt` for password protection or `SetWriteProtection` for write protection.

Save the protected file with `SaveFormat::Pptx`.

## Other Supported Protect Formats
