Edit PPTM Files in C#
Edit PPTM presentations in C# using server-side Aspose.Slides for .NET APIs.
Edit PPTM File Using C#
Use Aspose.Slides for .NET to load a PPTM macro-enabled presentation, update slide content, and save the result. Install the package from NuGet or run the following command in the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.Slides.NET
Edit PPTM Files - C#
using var presentation = new Presentation("document.pptm");
var slide = presentation.Slides[0];
if (slide.Shapes[0] is IAutoShape shape && shape.TextFrame is not null)
{
shape.TextFrame.Text = "New text";
}
presentation.Save("document.pptm", SaveFormat.Pptm);
Steps for Editing PPTM Files in C#
Basic document editing with Aspose.Slides for .NET can be done with a few lines of C# code.
Load the PPTM file with a Presentation object.
Access the target slide and shape through variables.
Update the text through TextFrame.
Save the edited presentation with SaveFormat.Pptm.
System Requirements
Before executing the code below, make sure that you have the following prerequisites.
- A supported operating system with .NET or Mono installed.
- A development environment such as Microsoft Visual Studio.
- Aspose.Slides for .NET referenced in your project.
Online PPTM Editor Live Demos
Edit PPTM documents online with the Aspose.Slides Editor app.
PPTM What is PPTM File Format?
Files with the PPTM extension are macro-enabled PowerPoint presentation files. They can contain slides, formatting, multimedia, and macros for automation or custom behavior.
Read More