///<summary>&nbs
p;
/// 把PowerPoint文件转换成@R_
304_1500@文件
///</summary>
///<par
am name="sourcePath">
源文件路径</param>
///<param name="t
argetPath">目标文件路径</param>
///<returns>成功返回true,失败返回false</returns>
p
ublic
static bool PPTConvertToPDF(string sourcePath, string targetPath)
{
bool result;
PpSaveAsFileTy
PE ppSaveAsFileType = PpSaveAsFileType.ppSaveAsPDF;//转换成pdf
object missing = Type.Missing;
Microsoft.Office.Interop.PowerPoint.ApplicationClass application = null;
PResentation persentation = null;
try
{
application = new Microsoft.Office.Interop.PowerPoint.ApplicationClass();
persentation = application.Presentations.Open(sourcePath, MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse);
if (persentation!=null)
{
persentation.SaveAs(targetPath, ppSaveAsFileType, MsoTriState.msoTrue);
}
result = true;
}
catch
{
result = false;
}
finally
{
if (persentation != null)
{
persentation.Close();
persentation = null;
}
if (application != null)
{
application.Qu
IT();
application = null;
}
}
return result;
}