C# 打开PPT文件另存为PPTX

时间:2023-02-08 23:10:08
        /// <summary>
/// rename PPT
/// </summary>
private static void renamePPT()
{
//add references Microsoft.Office.Interop.PowerPoint
//using PowerPoint = Microsoft.Office.Interop.PowerPoint;
string pptPath = @"R:\LiChao\Temp\test\CCB_F4I;09_Field Work - Part 1 Field Work.ppt";
var app = new PowerPoint.Application();
//add references System.Core
//using Microsoft.Office.Core;
app.Presentations.Open2007(pptPath, MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoFalse);
app.ActivePresentation.SaveAs(@"R:\LiChao\Temp\test\CCB_F4I;09_Field Work - Part 1 Field Work.pptx", PpSaveAsFileType.ppSaveAsDefault, MsoTriState.msoFalse);
app.ActivePresentation.Close();
}