Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save documentprocessing/4d6831a0887a9b763506c11713f635b1 to your computer and use it in GitHub Desktop.
Save documentprocessing/4d6831a0887a9b763506c11713f635b1 to your computer and use it in GitHub Desktop.
Insert Text in PowerPoint Presentation PPTX file in .NET
// Create a new PowerPoint presentation at the specified file path
Presentation presentation = Presentation.Create("PowerPointPreesentation.pptx");
// Create a text shape for the title and set its properties
TextShape shape = new TextShape();
shape.Text = "Title: First Title From Fileformat.Dev";
shape.TextColor = "980078";
shape.FontFamily = "Arial";
// Create the slide and add the text shape to it
Slide slide = new Slide();
slide.AddTextShapes(shape);
// Append the slide to the presentation
presentation.AppendSlide(slide);
// Save the modified presentation
presentation.Save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment