PPT PPTX ODP POT ppsx
Aspose.Slides  for .NET
PPT

Lock or Password Protect PPT using C#

Build your own .NET apps to protect presentation files using server-side APIs.

Protecting a PPT Presentation via C#

Using Aspose.Slides for .NET, you can protect your PPT presentation from opening or modification by setting a password. Then, to open or modify the locked presentation, a user has to provide the password.

Encrypting a PPT Presentation using C#


using (Presentation presentation = new Presentation("pres.ppt"))
{
    presentation.ProtectionManager.Encrypt("123123");
    presentation.Save("encrypted-pres.ppt", SaveFormat.Ppt);
}

Setting Write Protection to a PPT Presentation using C#


using (Presentation presentation = new Presentation("pres.ppt"))
{
    presentation.ProtectionManager.SetWriteProtection("123123");
    presentation.Save("write-protected-pres.ppt", SaveFormat.Ppt);
}

How to Password Protect PPT via C#

These are the steps to Protect PPT files.

  1. Load PPT with an instance of Presentation

  2. Protect the presentation using ProtectionManager class

  3. Save result in PPT format

Other Supported Protect Formats

Using C#, You can also protect the following formats: