Im using the following code below to open and export ppt slides as jpegs and this works fine on a windows 2003 server but on a windows 2008 server I get the following error:
“Caught exception: Source: Microsoft Office PowerPoint 2007 Description: PowerPoint could not open the file.D:\wwwroot\SlideManagerDemo\public\ emp\ est.ppt”
On windows 2008 I can see from the task manager that when I run this page, it creates the application instance fine but when I try to open/create files it just falls over.
(I do have msoffice 2007 installed on server)
Anyone have any further ideas (im sure im missing a tickbox somewhere?)
$strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"])))."\\\ emp\\\\";
$ppApp = new COM("powerpoint.application") or die("Unable to instantiate Powerpoint");
$ppApp->Visible = True;
$ppName = $strPath."test.ppt";
$FileName = "slides";
//*** Open Document if exists***//
if(file_exists($ppName)) {
try {
$pres = $ppApp->Presentations->Open($ppName, False, True, True);
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), $ppName, "\
";
}
try {
$pres->SaveAs($strPath."\\\\".$FileName,17); //'*** 18=PNG, 19=BMP **'
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\
";
}
}
$ppApp->Quit;
$ppApp = null;
Additional configs added to the server are:
DCOM config
Component Services->Computers->My Computer->DCOM config-> Microsoft PowerPoint Presentation
[LIST][] Launch Permission - IUSR added with Local Activation permission
[] Launch Permission - NETWORK SERVICES added with Local Activation permission
[] Local Activation - IUSR added with Local Activation permission
[] Local Activation - NETWORK SERVICES added with Local Activation permission[/LIST]
php.ini
- com.allow_dcom = true
folder permissions that contain ppt files
[LIST][] IUSR added with full control
[] Everybody added with full control (makes no different)
[*] NETWORK SERVICES added with full control (makes no different)[/LIST]
Further notes:
Its worth mentioning that I have noticed a huge processor usage increase when upgrading from msoffice 2003 -> 2007