因为最近方便看老师的课件, 所以我就决定自制一个批量ppt转pdf的小程序用
效果如图
首先是转换的函数
public bool ptp(string Path,string OutPath)
{
bool result;
var targetType = Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType.ppSaveAsPDF;
try
{
var application = new Microsoft.Office.Interop.PowerPoint.ApplicationClass();
var persentation = application.Presentations.Open(Path, MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse);
persentation.SaveAs(OutPath, targetType, Microsoft.Office.Core.MsoTriState.msoTrue);
result = true;
}
catch
{
result = false;
}