//Creates a new Presentation instance.
IPresentation pptxDoc = Presentation.Create();
//Adds a blank slide into the Presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
// Adds a textbox to hold the list
IShape textBoxShape = slide.AddTextBox(65, 140, 410, 100);
// Adds a new paragraph with the text in the left-hand side textbox.
IParagraph paragraph = textBoxShape.TextBody.AddParagraph("Turned off call to get the breakfast from Wendy's Launch date: 4 / 8, 4 / 18, 4 / 22");
//Sets the list type as Numbered
paragraph.ListFormat.Type = ListType.Numbered;
//Sets the numbered style (list numbering) as Arabic number following by period.
paragraph.ListFormat.NumberStyle = NumberedListStyle.ArabicPeriod;
//Sets the starting value as 1
paragraph.ListFormat.StartValue = 1;
//Sets the list level as 1
paragraph.IndentLevelNumber = 1;
// Sets the hanging value
paragraph.FirstLineIndent = -20;
//Create new instance of memory stream
MemoryStream outputStream = new MemoryStream();
//Save the Presentation
pptxDoc.Save(outputStream);
outputStream.Position = 0;
//Closes the Presentation
pptxDoc.Close(); |