Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have 20 powerpoint files sitting in a web server directory. Each one has one powerpoint slide only. I need to create one file that shows all 20 of the powerpoint files in just one pdf or ppt file. I am not sure how to loop through the 20 powerpoint files and append all of them into the one powerpoint or pdf file? Please advise

Replies are listed 'Best First'.
Re: Consolidate files into file
by CountZero (Bishop) on Apr 20, 2009 at 03:38 UTC
    In Win32::PowerPoint we read:
    This module uses Win32::OLE internally. You can fully control PowerPoint through these accessors. If you don't know what to do with them, launch PowerPoint, and try Record New Macro (from the Tools menu, then, Macro, and voila) and do what you want, and see what's recorded (from the Tools menu, then Macro, and Macro... submenu. You'll see Visual Basic Editor screen). If you don't know how to convert Visual Basic statements to perl's OLE methods, see Win32::OLE and other appropriate documents like intermediate books on PowerPoint and Visual Basic (after all, this module is just a thin wrapper of them).
    It looks like you are down to speaking directly to Win32::OLE

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Consolidate files into file
by ww (Archbishop) on Apr 20, 2009 at 02:09 UTC

    Without recommendation, and since PowerPoint suggests you're using Windows, this, from ppm search ppt:

    ppt Version: 0.14 Released: 2004-08-05 Author: Casey West <casey@geeknest.com> Repo: ActiveState Package Repository CPAN: http://search.cpan.org/dist/ppt-0.14/

    and, while not what you're looking for, this, from ppm search powerpoint may contain code that will help you get started:

    Win32-PowerPoint helps to convert texts to PP slides Version: 0.09 Released: 2008-10-31 Author: Kenichi Ishigaki <ishigaki@cpan.org> Provide: Win32::PowerPoint version 0.09 Provide: Win32::PowerPoint::Constants version 0.09 Require: Class::Accessor Require: Exporter::Lite Require: File::Spec Require: Test::More version 0.47 or better Require: Test::UseAllModules version 0.09 or better Require: Win32::OLE Repo: ActiveState Package Repository CPAN: http://search.cpan.org/dist/Win32-PowerPoint-0.09/

    Update: Assumes you control the server or know how to d/l the ppts.

      "ppt" stands for Perl Power Tools and has nothing to do with Powerpoint file manipulation. Win32::Powerpoint, as indicated in the description you included, converts text to slides, which isn't what the OP asked for.
        Thank you for your observation.

        Nonetheless (and despite NOT being the application sought by OP) Win32::Powerpoint may provide some pointers, as, for example, this code therein:

        $self->{application} = Win32::OLE->GetActiveObject('PowerPoint.Application');