- 使用 C# 将 MPP 文件转换为 Word DOC/DOCX 文件
我们将使用
使用 C# 将 MPP 文件转换为 Word DOC/DOCX 文件
可以使用下面给出的步骤轻松地将 MPP 文件转换为 Word 文档。
- 使用Project 类加载 MPP 文件 。
- 创建MemoryStream类的实例。
- 使用Project.Save(Stream stream, SaveFileFormat format)方法将项目作为 PDF 保存到流中。
- 使用Document类从流中加载 PDF 。
- 使用Document.Save(string outputFileName, SaveFormat format)方法将 PDF 保存为 Word 文档。
以下示例代码显示了如何使用 C# 将 MPP 文件转换为 Word 文档。
// Load the MPP fileProject project = new Project("SourceDirectory\Tasks\project_test.mpp");// Create an instance of the MemoryStream classMemoryStream stream = new MemoryStream();// Save the project as PDF to the MemoryStreamproject.Save(stream, SaveFileFormat.PDF);// Load the PDF from the MemoryStreamDocument document = new Document(stream);// Save the PDF as DOCXdocument.Save("OutputDirectory\SaveProjectAsDocx_out.docx", SaveFormat.DocX);
如果你想试用Aspose的全部完整功能,可联系在线客服获取30天临时授权体验。
还想要更多吗可以点击阅读【Aspose最新资源在线文库】,查找需要的教程资源。如果您有任何疑问或需求,请随时加入Aspose技术交流群(),我们很高兴为您提供查询和咨询。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!