Loss of macros in PPTM file when loaded


#1

Hello,

I would like to report a bug detected during my work using Aspose, specifically the Slides module. I used the version 18.11.

My work required me to use Aspose.Slides to load a pptm file, modify it, and save this modified file elsewhere. All of this was done using Java.

The original file contained a macro designed to mark each page of the file with “Page X of Y” with X and Y being the appropriate values. The macro was called every time the file was saved.

However, upon testing, the modified file no longer had the macro active.

After investigating the issue, I found that its source was that when my code opened the source file to create an object com.aspose.slides.Presentation, it removed the reference to the macro in the .rels file (found in the _rels directory of the pptm file).

The workaround I found was to unzip the generated powerpoint file, replace the .rels file with a correct version stored locally, then zip the folder back to a powerpoint file and use that one instead.

That method worked and allowed me to complete my assignment, but it did take a long time to isolate and solve the issue.

Regards,

Julien Armand


#2

@JulienARMAND26,

Can you please share source file and sample project so that we may further investigate to help you out.


#3

Hello,

Sorry for the long delay before my answer.
Here is the PPTM file used as source, as well as the java code which causes the loss of the macro updating the slide number (TestMacroLost.java) and the corrective we developed (TestMacroKept.java).
The file SourceRels (which is the .rels file of TestLossMacro.pptm) is necessary to the fix, as it replaces the one created by Aspose during the reading/writing of the source PPTM file.

Regards,

Julien Armand

ReturnLossMacroJulienArmand.zip (40.6 KB)


#4

@JulienARMAND26,

I have worked with source file and sample code shared by you and unable to observe any issue. As you already mentioned about Apsose.Slides java 18.11 you are using on your end. I suggest you to please use latest version 19.7 on your end and if there is still an issue than please share generated result as well so that we may further investigate to help you out.