我试图用下面的代码做到这一点:
using Microsoft.Office.Core;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using System.IO;
using Microsoft.Office.Interop.PowerPoint;
namespace SavePPT
{
class Program
{
static void Main(string[] args)
{
Application app = new PowerPoint.Application();
var pres = app.Presentations;
var file = pres.Open(@"C:\Presentation1.pptx", MsoTriState.msoTrue, MsoTriState.msoTrue, MsoTriState.msoFalse);
file.SaveCopyAs(@"C:\presentation1.wmv", PowerPoint.PpSaveAsFileType.ppSaveAsWMV, MsoTriState.msoCTrue);
app.Quit();
}
}
}
但是这个解决方案创建了 0 KB 大小的文件,当然我不能播放它。