sub addMyFile{ my $file = shift; #this is the filename of the file i am adding my $fullpath = "$edmdir\\$file"; #full filename with path my $pptadd = Win32::OLE->new( 'PowerPoint.Application', 'Quit' )or die "Can't create PowerPoint OLE: $!\n"; $pptadd->{Visible} = 1; my $addpres = $pptadd->Presentations->Open( $fullpath ) or die "Can't open PowerPoint file '$fullpath': $!\n"; # this is the second presentation.... i need to add it to the first one which has variable $pres my @slides; my $j = 1; my $slide; while ($addpres->Slides($j)){$slides[$j] = $addpres->Slides($j);$j++}; #this goes one too many, but I am working on it. my $k = 1; foreach $slide (@slides){ $pres -> Slides($slideIndex) = $slides[$k]; $slideIndex++; $k++}; }