So I'm trying to manipulate a PowerPoint show that I already created.
So naturally I load the ppt up, and then start manipulating. Now when I go to save the file to a new file it throws the exception "System.ArgumentException: The node to be removed is not a child of this node".
My code:
- Code: Select all
FileStream to_stream = new FileStream("C:\\Users\\aalbaek-nt\\Desktop\\Agenda.pptx", FileMode.Create);
presentation.SaveToFile(to_stream, FileFormat.Pptx2010); // <- exception thrown here
to_stream.Close();
System.Diagnostics.Process.Start("C:\\Users\\aalbaek-nt\\Desktop\\Agenda.pptx");
if any clarification is needed, please do let me know
EDIT: This leads to an empty presentation being created. Though it still throws the exception, and halts the program.