Problem saving a powerpoint file

Hi Guys

Any ideas on how I solve this?

I’m using this code to try and save a powerpoint file


<?php
try {
	$powerpnt = new COM("powerpoint.application");
	//Creating a new presentation
	$pres=$powerpnt->Presentations->Add();
	//Adds the first slide. "12" means blank slide
	$pres->Slides->Add(1,12);
	//Adds another slide. "10" means a slide with a clipart and text
	$pres->Slides->Add(2,10);
	//Adds a textbox
	$pres->Slides[1]->Shapes->AddTextbox(1,20,50,300,40);
	//Save the document as PPT file
	$powerpnt->Presentations[1]->SaveAs("MY_URL/temp/test1.ppt");

	//free resources and quit powerpoint
	$powerpnt->quit();
}
catch(com_exception $e) {
	echo $e->getMessage();
}
?>

All shows me is this error message


Source: Microsoft Office PowerPoint 2003
Description: Presentation.SaveAs : An error occurred while PowerPoint was saving the file.

Would anybody know what is going wrong, my guess it’s some sort of permission problem but I’m not sure on how to get around it?? It’s using IIS :mad:

Any help would be much appreciated

Crabby

Should be a path not a url.
SaveAs("MY_URL/temp/test1.ppt")

Hi

Thanks for your reply, I forgot to change the code back this is what I was originally doing


$powerpnt->Presentations[1]->SaveAs("c:\\DOCS\	est.ppt");

But I still get the same message??

OLEY!!! This worked, I had to escape the directory seperators!!


$powerpnt->Presentations[1]->SaveAs("c:\\\\DOCS\\\	est.ppt");