Sorry folks, I really have no idea what I am doing here, but this is my goal. I am building a powerpoint presentation that will be a compilation of various presentations. Right now I am having trouble adding the slides from the second file to the first file. The following code returns this error: Win32::OLE(0.1502) error 0x80048240 in METHOD/PROPERTYGET "Slides" at powerpoint_create_withEDM.pl line 256 Can't modify non-lvalue subroutine call at powerpoint_create_withEDM.pl line 259.
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 "Ca +n't open PowerPoint file '$fullpath': $!\n"; # this is the second pr +esentation.... 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++}; }
Any help would be greatly appreciated. Thanks,
~~David~~

In reply to Adding Slide to Powerpoint by ~~David~~

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.