<?xml version="1.0" encoding="windows-1252"?>
<node id="601131" title="Re^2: Adding Slide to Powerpoint" created="2007-02-20 11:34:54" updated="2007-02-20 06:34:54">
<type id="11">
note</type>
<author id="353127">
~~David~~</author>
<data>
<field name="doctext">
Everyone, Thanks for your help.  For reference, here is the working code... 

&lt;code&gt;sub addMyFile{
    my $file = shift;  #this is the filename of the file i am adding
    my $fullpath = "$edmdir\\$file";  #full filename with path
    my $addpres = $ppt-&gt;Presentations-&gt;Open( $fullpath ) or die "Can't open PowerPoint file '$fullpath': $!\n";
 
    my @slides;
    my $j = 1;
    my $slide;
  
    while ($addpres-&gt;Slides($j)){$slides[$j] = $addpres-&gt;Slides($j);$j++};  

    shift(@slides);  #because I start at 1, i need to drop off the first element.
    my $m;  
    my $k = 0;
    foreach (@slides){ 
        $m = $k+1;   #because slide index starts at 1, not 0;
        $addpres-&gt;Slides($m)-&gt;Copy;   #copy newly opened file slide...
        $pres-&gt;Slides-&gt;Paste($slideIndex);  #past it into current presentation.
        $slideIndex++; 
        $k++;
     }
}
&lt;/code&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-353127"&gt;
~~David~~
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
600522</field>
<field name="parent_node">
600532</field>
</data>
</node>
