I'd like to be able to alter a Powerpoint file that has macros. I'd like to be able to save it to a new file that maintains those macros.
However, the macros seem to be stripped off in the saving process.
- Code: Select all
var pptPresentation = new Presentation(presentationTemplate, FileFormat.Auto);
...
Code to alter presentation
...
var hasMacros = pptPresentation.HasMacros;
using (var presentation = new MemoryStream())
{
pptPresentation.SaveToFile(presentation, FileFormat.Auto);
}
hasMacros is true, suggesting that altering it hasn't stripped the macros, but the saved file has none.
I've tried some of the different file formats with no luck. There isn't a specific pptm format.
Thanks,
James