Click to See Complete Forum and Search --> : Using PHP COM with Powerpoint


llebron
12-08-2001, 05:42 PM
I don't have a lot of experience with COM. What I am trying to do is use PHP to create PowerPoint slides. So far I have been able to open PowerPoint, create a new presentation, add blank slides to the presentation and save the presentation. However, I haven't been able to modify the actual slides. How would I, for example, add or change the title of the slide? The only PHP COM examples I have seen cover Word and Excel but I guess? Powerpoint is somewhat different. Any help would be greatly appreciated.

Luis

llebron
12-10-2001, 12:30 PM
Here's the actual code I'm using

#Instantiate the PowerPoint component.
$ppoint = new COM("PowerPoint.application") or die("Unable to instantiate PowerPoint");

#Show powerpoint
$ppoint->Visible = 1;
#Create a new presentation
$ppoint->Presentations->Add() or die ("Could not create presentation");

//Add a slide to the document
$firstslide=$ppoint->Presentations[1]->Slides->Add(1,1);

//Save the presentation
$ppoint->Presentations[1]->SaveAs("/path/test.ppt");
$ppoint->Presentations[1]->Close();

Anon
01-23-2002, 05:17 PM
You might want to look up the Object Library of Powerpoint within the Visual Basic Editor to get an inspiration.

Your code works fine with me too :-)

Do you have a working code-example for word2k as well? I tried all available examples but none did work.