代码如下:
private bool PPTConvertToPDF(string sourcePath, string targetPath)
{
bool result;
PowerPoint.PpSaveAsFileType targetFileType = PowerPoint.PpSaveAsFileType.ppSaveAsPDF;
object missing = Type.Missing;
PowerPoint.ApplicationClass application = null;
PowerPoint.Presentation persentation = null;
//application.Visible = true;
try
{
application = new PowerPoint.ApplicationClass();
persentation = application.Presentations.Open(sourcePath, MsoTriState.msoFalse , MsoTriState.msoFalse, MsoTriState.msoTrue);
persentation.SaveAs(targetPath, targetFileType, MsoTriState.msoTrue); result = true;
}出错地方:
persentation = application.Presentations.Open(sourcePath, MsoTriState.msoFalse , MsoTriState.msoFalse, MsoTriState.msoTrue);错误原因:
Presentations (unknown member) : Invalid request. The PowerPoint Frame window does not exist.怎么解决!c#powerpointPdf
private bool PPTConvertToPDF(string sourcePath, string targetPath)
{
bool result;
PowerPoint.PpSaveAsFileType targetFileType = PowerPoint.PpSaveAsFileType.ppSaveAsPDF;
object missing = Type.Missing;
PowerPoint.ApplicationClass application = null;
PowerPoint.Presentation persentation = null;
//application.Visible = true;
try
{
application = new PowerPoint.ApplicationClass();
persentation = application.Presentations.Open(sourcePath, MsoTriState.msoFalse , MsoTriState.msoFalse, MsoTriState.msoTrue);
persentation.SaveAs(targetPath, targetFileType, MsoTriState.msoTrue); result = true;
}出错地方:
persentation = application.Presentations.Open(sourcePath, MsoTriState.msoFalse , MsoTriState.msoFalse, MsoTriState.msoTrue);错误原因:
Presentations (unknown member) : Invalid request. The PowerPoint Frame window does not exist.怎么解决!c#powerpointPdf
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货