in reply to How can I access data included in a ppt slide ?

You can download the ppt specs at http://www.wotsit.org (search for "ppt").

The document is a zipped html directory.

Appendix 3 is specially interesting: "Sample code to read the text out of a PowerPoint '97 presentation." (in C++)

If you make a Perl version of this, it would be nice if you could submit it to CPAN!

  • Comment on Re: How can I access data included in a ppt slide ?

Replies are listed 'Best First'.
Re: Re: How can I access data included in a ppt slide ?
by Foggy Bottoms (Monk) on Jun 06, 2003 at 08:58 UTC
    Well so far, I've managed to do easy things thanks to the MSDN such as adding slides (where and which exact type) and drawing text areas, shapes, labels... However, I can't seem to add text : one of the VB syntaxes (there's several ways apparently) MS provides is the following :
    Set oTitle = ActivePresentation.Slides(2).Objects.Title
    This would be the VB code (according to MSDS). I assume the perl code would be :
    $ppt->ActivePresentation->Objects->Slides($nb)->Title->Text = "TaGaDa"
    where $ppt is
    $ppt = Win32::OLE->GetActiveObject(MSPPT.'.Application') and works just fine.
    However, Perl doesn't seem to know what objects. is and returns the following error :
    Can't call method "Slides" on an undefined value at D:\source\powerpoint.pl line 23.
    MSDSN reference is here :
    http://www.msdn.microsoft.com/library/en-us/dnpower97/html/ppppt_w95.asp?frame=true#ppppt_w95_work

    If u have any idea, let me know, thanks !!!

      You can use "QueryObjectType" for debugging.
      Print the object type for "$ppt", and the object type of "$ppt->ActivePresentation" and check if they are what you expected.

      Win32::OLE->QueryObjectType(OBJECT) The QueryObjectType() class method returns a list of the type library name and the objects class name. In a scalar context it returns the class name only. It returns undef when the type information is not available.