1

I already work and succeed with wordprocessingML but not with presentationML. My problem is that my size's file is 0ko and I do not know why. I know it is enough to create an empty word document but is it enough for an empty powerpoint? I follow some tutorials but no one work (for me) What is the good way to create a powerpoint?

I resume my code by this (I try to create an empty archive)

this->m_package = System::IO::Packaging::Package::Open(sPath, System::IO::FileMode::Create, System::IO::FileAccess::ReadWrite);

System::Uri ^ uriDoc = gcnew System::Uri("/ppt/presentation.xml", System::UriKind::Relative);
this->m_packagePart = this->m_package->CreatePart(uriDoc, "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml");
System::IO::StreamWriter^ streamPart = gcnew System::IO::StreamWriter(this->m_packagePart->GetStream(System::IO::FileMode::Create, System::IO::FileAccess::Write));
this->m_package->CreateRelationship(uriDoc, System::IO::Packaging::TargetMode::Internal, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", "rId1");
DocumentFormat::OpenXml::Packaging::OpenSettings^ openSet = gcnew DocumentFormat::OpenXml::Packaging::OpenSettings;
openSet->MaxCharactersInPart = 0;

this->m_presentationDoc = DocumentFormat::OpenXml::Packaging::PresentationDocument::Open(this->m_package, openSet);

this->m_presentationPart = this->m_presentationDoc->PresentationPart;
this->m_presentationPart->Presentation = gcnew DocumentFormat::OpenXml::Presentation::Presentation();

Thanks for advance

Todd Main
  • 28,951
  • 11
  • 82
  • 146
townyoh
  • 11
  • 2

0 Answers0