PowerPoint File Properties

GemBox.Presentation supports two types of file properties: built-in and custom.

Built-in properties contain general information about the document, such as the title, authors, date, etc. Custom properties are those that users define, both name and value.

With the following example, you can learn how to read and read both built-in and custom presentation properties.

PowerPoint file's built-in and custom document properties
Screenshot of document properties from PowerPoint file
Upload your file (Drag file here)
using System;
using GemBox.Presentation;

class Program
    static void Main()
        // If using the Professional version, put your serial key below.

        var presentation = PresentationDocument.Load("%InputFileName%");
        var properties = presentation.DocumentProperties;

        Console.WriteLine("# Built-in document properties:");

        // Write built-in document properties.
        properties.BuiltIn[BuiltInDocumentProperty.Title] = "My Title";
        properties.BuiltIn[BuiltInDocumentProperty.DateLastSaved] = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ssZ");

        // Read built-in document properties.
        foreach (var builtinProperty in properties.BuiltIn)
            Console.WriteLine($"{builtinProperty.Key,20}: {builtinProperty.Value}");

        Console.WriteLine("# Custom document properties:");

        // Write custom document properties.
        properties.Custom["My Custom Property 1"] = "My Custom Value";
        properties.Custom["My Custom Property 2"] = 123.4;

        // Read custom document properties.
        foreach (var customProperty in properties.Custom)
            Console.WriteLine($"{customProperty.Key,20}: {customProperty.Value,-20} [{customProperty.Value.GetType()}]");
Imports System
Imports GemBox.Presentation

Module Program

    Sub Main()

        ' If using the Professional version, put your serial key below.

        Dim presentation = PresentationDocument.Load("%InputFileName%")
        Dim properties = presentation.DocumentProperties

        Console.WriteLine("# Built-in document properties:")

        ' Write built-in document properties.
        properties.BuiltIn(BuiltInDocumentProperty.Title) = "My Title"
        properties.BuiltIn(BuiltInDocumentProperty.DateLastSaved) = DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ssZ")

        ' Read built-in document properties.
        For Each builtinProperty In properties.BuiltIn
            Console.WriteLine($"{builtinProperty.Key,20}: {builtinProperty.Value}")

        Console.WriteLine("# Custom document properties:")

        ' Write custom document properties.
        properties.Custom("My Custom Property 1") = "My Custom Value"
        properties.Custom("My Custom Property 2") = 123.4

        ' Read custom document properties.
        For Each customProperty In properties.Custom
            Console.WriteLine($"{customProperty.Key,20}: {customProperty.Value,-20} [{customProperty.Value.GetType()}]")

    End Sub
End Module

See also

Next steps

GemBox.Presentation is a .NET component that enables you to read, write, edit, convert, and print presentation files from your .NET applications using one simple API.

Download Buy