Jak zapisać pliki * .ppt, * .pptx jako * .wmv używając Interop z C #?
Próbowałem to zrobić za pomocą następnego kodu:
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();
}
}
}
Ale to rozwiązanie stworzyło plik o rozmiarze 0 KB i oczywiście nie mogę go odtworzyć.