-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d50c7a
commit 0331f07
Showing
6 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
4 changes: 2 additions & 2 deletions
4
Macros/Load-and-save-macro-PowerPoint/.NET/Load-and-save-macro-PowerPoint/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
using Syncfusion.Presentation; | ||
|
||
//Load or open an PowerPoint Presentation. | ||
using FileStream inputStream = new(Path.GetFullPath(@"../../../Data/Template.pptm"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite); | ||
using FileStream inputStream = new(Path.GetFullPath(@"Data/Template.pptm"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite); | ||
//Open an existing PowerPoint presentation. | ||
using IPresentation pptxDoc = Presentation.Open(inputStream); | ||
//Add a blank slide to the presentation. | ||
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank); | ||
//Add a text box to the slide. | ||
IParagraph paragraph = slide.Shapes.AddTextBox(100, 100, 300, 80).TextBody.AddParagraph("Preserve Macros"); | ||
//Save the PowerPoint Presentation as stream. | ||
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptm"), FileMode.Create, FileAccess.ReadWrite); | ||
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptm"), FileMode.Create, FileAccess.ReadWrite); | ||
pptxDoc.Save(outputStream); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
using Syncfusion.Presentation; | ||
|
||
//Load or open an PowerPoint Presentation. | ||
using FileStream inputStream = new(Path.GetFullPath(@"../../../Data/Template.pptm"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite); | ||
using FileStream inputStream = new(Path.GetFullPath(@"Data/Template.pptm"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite); | ||
//Open an existing PowerPoint presentation. | ||
using IPresentation pptxDoc = Presentation.Open(inputStream); | ||
//Check whether the presentation has macros and then removes them. | ||
if (pptxDoc.HasMacros) | ||
pptxDoc.RemoveMacros(); | ||
//Save the PowerPoint Presentation as stream. | ||
using FileStream outputStream = new(Path.GetFullPath(@"../../../Result.pptx"), FileMode.Create, FileAccess.ReadWrite); | ||
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite); | ||
pptxDoc.Save(outputStream); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters