Corrupt presentation

I’ve attached a slide that is being corrupted by “my” install of powerpoint. Other computers are not causing this problem.

The error is “couldn’t read powerpoint record” and the internal error is “object reference not set to instance…”



Could you tell me what is wrong with the file so that I can debug this problem further?

Dear plunk,

The presentation seems to be corrupt, it opens well for the first time in MS-PowerPoint 2002, but when I resave it using Save As... menu command and then open it, it gives me error saying PowerPoint can't open C:\test.ppt because part of the file is missing.

Anyway, I have reported it for a fix.

Dear plunk,

Did you create this presentation using MS PowerPoint or Aspose.Slides.
In case you used Aspose.Slides please provide source ppt file and
your code with information how this presentation was created.

I done a lot more debugging and I found out where the problem is starting.

In our system we are taking a given presentation and breaking it up into parts:
a template presentation that only has masters
a presentation that contains slide one with a blank template
a presentation that contains slide two with a blank template
… and so on.


at first I wanted to read the Source Presentation and just delete what wasn’t neeaded for instance:
For getting templates:
read presentation
add an empty slide
delete everything that isn’t a master or that empty slide
save the template pres
For each slide:
read presentation
add blank template
change master of slide X to blank template
delete everything else
save slide X pres

The above method works but it can be very slow on large persentations because of the repeated reading of the original presentation.

Our current method goes like this:
SourcePresentation is read once
For getting templates:
create new TemplatePresentation
clone a SourcePresentation slide into TemplatePresentation position 2
change master of TemplatePresentation’s position 1 to the new master that got cloned
delete TemplatePresentation position 2
TemplatePresentation.DeleteUnusedMasters() - should remove the original blank master

save the TemplatePresentation
For getting each slide:
create new SlidePresentation
clone SourcePresentation slide X into SlidePresentation position 2
change master of SlidePresentation position 2 to the original master before cloning (plain one)
delete SlidePresentation position 1
SlidePresentation.DeleteUnusedMasters() - should remove the cloned master
save SlidePresentation X

We are using the second method right now and something is going wrong with the process. But before I make this post too long, can you tell me if the logic is right or if there might be a better way to split up a presentation.

Thanks
JP

I’d suggest changing logic. Try to minimize slide cloning and avoid ChangeMaster call if possible.
You break presentation but why not save it as one ppt file? Is it too large?
You always can load it later and use master or slides.

We are breaking the slide up because we are making a version control system for ppt and slides.
I am looking into a better way to handle this problem.


Can these corrupted files be fixed or are they lost? Opening and saving the presentation from Powerpoint does not fix the issue (at least for the ones I tested).

Just for sake of curiosity can you tell me what was wrong with the .ppt binary that it couldn’t be read?