none
Open xml sdk Merge presentations RRS feed

  • Question

  • I am trying to use the open xml sdk to merge powerpoint 2007 files.  I'm using this code http://msdn.microsoft.com/en-us/library/ee361883(v=office.12).aspx and for the most part it works but it seems to leave some styles out of the merged file and on open give me the error "Powerpoint found unreadable content in [filename] do you want to recover the contentes of thsi presentation?  just curious if anyone knows what the code in the link above may be missing?
    Tuesday, November 29, 2011 9:06 PM

All replies

  • maybe I should also say that these are in different pptx files.  what it's for is we are letting the users select what presentations they want to put in the merged file from a tree.  so we are trying to merge the files they select.  can be 1.  can be up to 20.  the article above is obviously missing something and I'm trying to find out what it is.
    Tuesday, November 29, 2011 9:10 PM
  • Tslinkard, have you found out the problem? If you still need any assistant about it, just feel free to let us know. I tried the code sample on my side, it works well and I didn't get the error just like what you described.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Thursday, December 1, 2011 2:57 AM
  • yeah, same problem  can I email you my template and source file and see if you can see what I am missing?
    Thursday, December 1, 2011 3:46 PM
  • Tslinkard, I have got your pptx files and use your template on my side, and I indeed encountered the error. How did you create your template file? I think you modified something after creating the template file. I create a empty pptx file as the template file on my side and it works well after generating the file MergedPresentation.pptx. You can try to create an empty powerpoint template and not to modify it.

    By the way, how about another powerpoint file which you emailed? I can open it ok without the error.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Friday, December 2, 2011 6:35 AM
  • the one I sent I admit I did take a file and simply delete the slides from it and saved it.  I just opened Powerpoint and saved the very first thing that came up as Template.pptx and I get the same thing.

     

    the other file is just one of the files I am trying to merge into the template. 

    Friday, December 2, 2011 2:21 PM
  • I downloaded the one from the article and tried it and get the same thing.  can you try the other file I sent and try to merge it and see if it gives you the error?  Perhaps it is something in our files that we are trying to merge. 
    Friday, December 2, 2011 6:52 PM
  • Tslinkard, sorry for the late reply. I also tried the other file 5bebe421-b13b-49e1-a4cd-b9402f78f1ac.pptx as the template and get the error you described. It is indeed difficult to find the root reason of the scenario. Are you willing to use an empty pptx template file without modifying anything?

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Tuesday, December 6, 2011 4:40 AM
  • yes, an empty template is fine.  I just need to merge files like that file listed above into it.  so the blank template is fine and again I tried the one from the example but when I merge the 5bebe421-b13b-49e1-a4cd-b9402f78f1ac.pptx  into the blank template is when I get the error.  do you see the same thing when you merge 5bebe421-b13b-49e1-a4cd-b9402f78f1ac.pptx into the blank template? 
    • Edited by tslinkard Tuesday, December 6, 2011 1:55 PM
    Tuesday, December 6, 2011 1:55 PM
  • >>but when I merge the 5bebe421-b13b-49e1-a4cd-b9402f78f1ac.pptx into the blank template is when I get the error. do you see the same thing when you merge 5bebe421-b13b-49e1-a4cd-b9402f78f1ac.pptx into the blank template?

    Tslinkard, I also tried but get an exception, I found that the filename can't be named like this, I rename it to be source1.pptx. After merging, I also got the error you described. I haven't figured out why it can't merge smmothly with your file. But the generate the file indeed contains the content from the source file, it only generate the error when opening.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Wednesday, December 7, 2011 6:11 AM
  • yes, that is what I have found also.  looks like everything is there.  just the error message and can't figure out why.  once it's opened I guess powerpoint fixes it.  the issue is we don't want our users to see this message so I'm looking for a way to find out what is causing the error and then how to fix it in the merger.

    Any thoughts on how I can find the cause of the error message?

    Wednesday, December 7, 2011 1:40 PM
  • Tslinkard, I've spent some time on researching it but found difficult to know the cause of the error message. It seems that the error happens specific to your files, however, the validator class also can't valide the error information.

    By the way, could you tell us how did you create your file? If you programmaticlly generate the file, could you show us the code?

    As for the problem, I will help you involve others to help you. There might be some delay about the response.Appreciate your patience.

    Below is the project and your tempate file named MergeDecks which I uploaded to the skydrive in order to let others research your problem:

    https://skydrive.live.com/#cid=C7D080162E80A07A&id=C7D080162E80A07A%21115&sc=documents

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Thursday, December 8, 2011 6:42 AM
  • They were generated in house using Powerpoint but I can't say what "Special" things they did to it if any.

    Thanks for the help. 

    Thursday, December 8, 2011 7:26 PM
  •  

     

    Thanks to Bruce Song for the .zip file at SkyDrive. In it are .pptx files that open with PowerPoint 2010 including the problem presentation.

     

    The presentation named “MergedPresentation.pptx”, when opened in PowerPoint 2010, and then repaired, contained one slide. The same file, when renamed “MergedPresentation.pptx.zip”, and unzipped, contained a file named [Content_Types].xml  that described many different slide masters including:
    PartName="/ppt/slideMasters/slideMaster36.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml" />

     

    There is nothing in the file to explain why the single slide had so many masters and other content types.

     

    The rest of the unpacked presentation contained 143 other files, most are either .rel files or .xml files plus 2 image files.  The problem lies embedded in the contents and/or relationships of one or more of those.

    Trouble-shooting why the problem happens might start by merging just the minimum one-slide presentation with a very simple template. The slide should be very simple, with default background (blank), default theme, default fonts, default everything. Provided this does not present the problem.

    This would be similar to the successful merge in the demo at http://msdn.microsoft.com/en-us/library/ee361883(v=office.12).aspx. But now you would have a presentation to which you could add one attribute at a time (theme, image, background, comment, etc. ) to see what causes the problem.

    An alternative approach to trouble-shooting is to compare the unpacked (unzipped) contents of the files before the merger against the merged, problem presentation’s unpacked .xml, .rel, and other members.

    If neither of the troubleshooting approaches permit you to pinpoint the cause of the problem, because of the complexity of this issue your questions fall into the paid support category which requires a more in-depth level of support.  Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    "…Mark as Answer" if my reply is helpful to you…”

    Regards,
    Chris Jensen
    Senior Technical Support Lead


    Friday, December 9, 2011 4:30 PM
    Moderator
  • I'm still at a loss.  I have simplified my documents down to these 2 files

    https://skydrive.live.com/?cid=ee0e0c195f132fb7&id=EE0E0C195F132FB7%21159

    1 Template and a Presentation file to merge into that template.  I still get the error.  both are made from scratch so no special formatting or anything else.  can you try them in your code and see if you get the error? 

    Monday, December 19, 2011 6:01 PM