How to Mark a Presentation as Final using Spire.Presentation in C#, VB.NET

2015-08-06 05:54:52 Written by  support iceblue
Rate this item
(0 votes)

The Mark as Final command makes a presentation read-only and prevents changes to the document. When you share a presentation that is marked as final, you're telling viewers the presentation is final and no changes on it are wanted. In this article, I'll make a brief introduction about how to mark a presentation as final using Spire.Presentation in C#, VB.NET.

In Spire.Presentation, the presentation class contains a property of DocumentProperty which enables developers to set document properties easily. Here in this case, you are able to mark a presentation as final by setting the Boolean value of MarkAsFinal as true.

Code Snippet:

Step 1: Initialize a new instance of presentation class and load the sample file.

Presentation ppt = new Presentation();
ppt.LoadFromFile("sample.pptx",FileFormat.Pptx2010);

Step 2: Set the value of MarkAsFinal property as true.

ppt.DocumentProperty["_MarkAsFinal"] =true;

Step 3: Save and launch the file.

ppt.SaveToFile("result.pptx",FileFormat.Pptx2010);
System.Diagnostics.Process.Start("result.pptx");

Effect:

How to Mark a Presentation as Final using Spire.Presentation in C#, VB.NET

Full Code:

[C#]
using Spire.Presentation;
namespace MarkPPT
{
    class Program
    {
        static void Main(string[] args)
        {
            Presentation ppt = new Presentation();
            ppt.LoadFromFile("sample.pptx", FileFormat.Pptx2010);

            ppt.DocumentProperty["_MarkAsFinal"] = true;

            ppt.SaveToFile("result.pptx", FileFormat.Pptx2010);
            System.Diagnostics.Process.Start("result.pptx");
            System.Diagnostics.Process.Start("result.pptx");

            }
        }
    }
[VB.NET]
Imports Spire.Presentation
Namespace MarkPPT
	Class Program
		Private Shared Sub Main(args As String())
			Dim ppt As New Presentation()
			ppt.LoadFromFile("sample.pptx", FileFormat.Pptx2010)

			ppt.DocumentProperty("_MarkAsFinal") = True

			ppt.SaveToFile("result.pptx", FileFormat.Pptx2010)
			System.Diagnostics.Process.Start("result.pptx")
			System.Diagnostics.Process.Start("result.pptx")

		End Sub
	End Class
End Namespace

Additional Info

  • tutorial_title: Mark a Presentation as Final
Last modified on Friday, 24 September 2021 09:12