note 18460 modified in class.com by vrana
| From: | vrana@php.net | Date: | Thu, 05 Aug 2004 18:11:26 +0000 |
| Subject: | note 18460 modified in class.com by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74042@lists.php.net to get a copy of this message | ||
The example above (MS Word) is quiet unsatisfying, as I find. Especially since I couldn't find
anybody who actually got it running, including myself.
You might therefore give this Powerpoint-example a chance:
----------------------------------
#Instantiate a PowerPoint object.
$ppoint = new COM("PowerPoint.application") or die("Unable to instantiate
PowerPoint");
<?php
#Create a new presentation
$ppoint->Presentations->Add() or die ("Could not create presentation");
//Add a slide
$slide=$ppoint->Presentations[1]->Slides->Add(1,1);
//Get the name of this slide
$slidename = $slide->Name();
echo"<br>slidename : $slidename";
//Change the name of this new slide
$slide->Name = "New Slidename";
$slidename = $slide->Name();
echo"<br>NEW slidename : $slidename";
//Save the presentation
$ppoint->Presentations[1]->SaveAs("c:/InetPub/www/test.ppt");
$ppoint->Presentations[1]->Close();
//closing powerpoint
$ppoint->Quit();
//free the object
$ppoint->Release();
$ppoint = null;
-----------------------
?>
the config is :
w2k-server/office2k/iis5/php 4.1.1 isapi
If you happen to run into a working word2k-example, please let me know.
Marc
--was--
The example above (MS Word) is quiet unsatisfying, as I find. Especially since I couldn't find
anybody who actually got it running, including myself.
You might therefore give this Powerpoint-example a chance:
----------------------------------
#Instantiate a PowerPoint object.
$ppoint = new COM("PowerPoint.application") or die("Unable to instantiate
PowerPoint");
#Create a new presentation
$ppoint->Presentations->Add() or die ("Could not create presentation");
//Add a slide
$slide=$ppoint->Presentations[1]->Slides->Add(1,1);
//Get the name of this slide
$slidename = $slide->Name();
echo"<br>slidename : $slidename";
//Change the name of this new slide
$slide->Name = "New Slidename";
$slidename = $slide->Name();
echo"<br>NEW slidename : $slidename";
//Save the presentation
$ppoint->Presentations[1]->SaveAs("c:/InetPub/www/test.ppt");
$ppoint->Presentations[1]->Close();
//closing powerpoint
$ppoint->Quit();
//free the object
$ppoint->Release();
$ppoint = null;
-----------------------
the config is :
w2k-server/office2k/iis5/php 4.1.1 isapi
If you happen to run into a working word2k-example, please let me know.
Marc
http://php.net/manual/en/class.com.php