Everyone, Thanks for your help. For reference, here is the working code...
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->Presentations->Open( $fullpath ) or die "Can't
+ open PowerPoint file '$fullpath': $!\n";
my @slides;
my $j = 1;
my $slide;
while ($addpres->Slides($j)){$slides[$j] = $addpres->Slides($j);$j
+++};
shift(@slides); #because I start at 1, i need to drop off the fir
+st element.
my $m;
my $k = 0;
foreach (@slides){
$m = $k+1; #because slide index starts at 1, not 0;
$addpres->Slides($m)->Copy; #copy newly opened file slide...
$pres->Slides->Paste($slideIndex); #past it into current pres
+entation.
$slideIndex++;
$k++;
}
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|