Quantcast
Channel: Java Programming Forum - Learn Java Programming - Apache POI
Viewing all articles
Browse latest Browse all 120

POI and Macros in Powerpoint

$
0
0
Hi,

I've tried to modify a powerpoint presentation which contains a macro (eg. "Test.pptm"). After saving the presentation and opening it with powerpoint, powerpoint crashes when I try to open the macros??
What am I doing wrong?

This is how I open the presentation:
Code:

// (templateStream being an InputStream to my report.pptm file).
this.pkg = OPCPackage.open(templateStream);
this.ppt = new XMLSlideShow(pkg);

This is how I store the presentation:
Code:

OutputStream os = new FileOutputStream(new File(fileName));
pkg.save(os);
os.close();

I tried POI version 3.9 and 3.10 FINAL with no success. I'm using Office 10.
Everything works fine when I remove the macro and use the extension ".pptx"

Kind regards,
Frank

Viewing all articles
Browse latest Browse all 120