1

I was trying to insert a new slide into my presentation by following the https://msdn.microsoft.com/EN-US/library/office/cc850834.aspx

It throws me the error: Archive file cannot be size 0

My code:

string presentationFile=@"C:\Users\SS\Desktop\TestPresentation6.pptx";
public static void InsertNewSlide(string presentationFile, int position, string slideTitle)
{ 
    using (PresentationDocument presentationDocument = PresentationDocument.Open(presentationFile, true))
    {
       // Pass the source document and the position and title of the slide to be inserted to the next method.
       InsertNewSlide(presentationDocument, position, slideTitle);
    }
}

Am using open XML SDK 2.5. Could anyone help me in understanding what is this error indicates. I could not find any useful solution. Anybody had faced the same issue?

Appreciate your time!!

Thanks!!!

MethodMan
  • 18,625
  • 6
  • 34
  • 52
Shruthi
  • 11
  • 1
  • 4
  • can you post what the xml data structure looks like in your `TestPresentation6.pptx` – MethodMan Sep 16 '15 at 16:42
  • sounds like the xml file may not be formatted correctly. – MethodMan Sep 16 '15 at 16:42
  • 1
    @MethodMan - Thanks for your initiative. I resolved the issue. The InsertNewSlide() was called before the presentation was created ccompletely. So it threw an error. Now it works fine. – Shruthi Sep 16 '15 at 17:41

0 Answers0