Aspose.Slides.Examples.CSharp.Presentations.Properties.AddCustomDocumentProperties.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_PresentationProperties();

            // Instantiate the Presentation class
            Presentation presentation = new Presentation();

            // Getting Document Properties
            IDocumentProperties documentProperties = presentation.DocumentProperties;

            // Adding Custom properties
            documentProperties["New Custom"] = 12;
            documentProperties["My Name"] = "Mudassir";
            documentProperties["Custom"] = 124;

            // Getting property name at particular index
            String getPropertyName = documentProperties.GetCustomPropertyName(2);

            // Removing selected property
            documentProperties.RemoveCustomProperty(getPropertyName);

            // Saving presentation
            presentation.Save(dataDir + "CustomDocumentProperties_out.pptx", Aspose.Slides.Export.SaveFormat.Pptx);

        }
    }
AddCustomDocumentProperties