I'm using the "Powerpoint Add in 1" project in Visual Studio 2013, and I have the following problem, I have a .ppt file with 2 slides, I need to separate these 2 slides into different presentations so I can do 2 different videos, video for slide 1 and the 2nd video for slide 2, but I'm only able to make a single video with the 2 slides.
string fileName = @"C:\testewiplay.pptx";
string exportName = "video_of_presentation";
string exportPath = @"C:\{0}.mp4";
Microsoft.Office.Interop.PowerPoint.Application ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
ppApp.Visible = MsoTriState.msoTrue;
ppApp.WindowState = PpWindowState.ppWindowMinimized;
Microsoft.Office.Interop.PowerPoint.Presentations oPresSet = ppApp.Presentations;
Microsoft.Office.Interop.PowerPoint._Presentation oPres = oPresSet.Open(fileName,
MsoTriState.msoFalse, MsoTriState.msoTrue,
MsoTriState.msoTrue);
try
{
oPres.Convert2(fileName);
oPres.CreateVideo(exportName, true, 5, 1080, 25, 100);
oPres.SaveCopyAs(String.Format(exportPath, exportName),
PowerPoint.PpSaveAsFileType.ppSaveAsMP4,
MsoTriState.msoCTrue);
}
catch (Exception msg)
{
var mensagem = msg.Message;
}
finally
{
ppApp.Quit();
}