0
I am using the project "Powerpoint Add in 1" in Visual Studio 2013, and I have the following problem, I have a . ppt with 2 slides, I need to separate these 2 slides into different presentations so I can make 2 different videos, 1st video referring to slide 1 and 2nd video referring to 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();
}