PPTX Encryption in C# and VB.NET

PPTX encryption enables you to securely protect the content of your PowerPoint presentation (PPTX) from unwanted viewers.

Following example shows how to load encrypted PPTX file and how to save presentation as encrypted PPTX file.

Input and output password should be specified in the appropriate text box. If password is empty, file won't be decrypted / encrypted.

Screenshot

PPTX Encryption Screenshot

See the full code below, use RUN EXAMPLE to execute.

Upload your file (Drag files here)

1using System.IO;
2using GemBox.Presentation;
3
4class Sample
5{
6    [STAThread]
7    static void Main(string[] args)
8    {
9        // If using Professional version, put your serial key below.
10        ComponentInfo.SetLicense("FREE-LIMITED-KEY");
11
12        string inputPassword = "inpass";
13        string outputPassword = "outpass";
14
15        var presentation = PresentationDocument.Load("PptxEncryption.pptx", new PptxLoadOptions() { Password = inputPassword });
16
17        presentation.Save("PPTX Encryption.pptx", new PptxSaveOptions() { Password = outputPassword });
18    }
19}
1Imports System.IO
2Imports GemBox.Presentation
3
4Module Samples
5
6    Sub Main()
7
8        ' If using Professional version, put your serial key below.
9        ComponentInfo.SetLicense("FREE-LIMITED-KEY")
10
11        Dim inputPassword As String = "inpass"
12        Dim outputPassword As String = "outpass"
13
14        Dim presentation = PresentationDocument.Load("PptxEncryption.pptx", New PptxLoadOptions With {.Password = inputPassword})
15        presentation.Save("PPTX Encryption.pptx", New PptxSaveOptions With {.Password = outputPassword})
16
17    End Sub
18
19End Module

Check next sample or find out more about GemBox.Presentation and GemBox Software.