Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^3: Adding Slide to Powerpoint

by traveler (Parson)
on Feb 16, 2007 at 23:43 UTC ( #600551=note: print w/replies, xml ) Need Help??

in reply to Re^2: Adding Slide to Powerpoint
in thread Adding Slide to Powerpoint

You do not need to switch presentations: using the proper var does that. Your old logic (with my changes) was better. Exactly what line gave the error on my version? Oh, and print out $k and $slideindex to be sure they are right and to figure when the error occurs.

Replies are listed 'Best First'.
Re^4: Adding Slide to Powerpoint
by ~~David~~ (Hermit) on Feb 17, 2007 at 00:00 UTC
    $pres -> Slides->Add($slideIndex,ppLayoutTitleOnly) = $slide; line gives the error "Can't modify non-lvalue subroutine call". If I remove the equals part, and try to add it to the next line, I get the right number of pages, but they are blank...
      My Bad. Your $slides are just pointers to ppt slides. Try
      my @slides; my $j = 1; my $slide; while ($addpres->Slides($j)){$slides[$j] = $addpres->Slides($j);$j +++}; my $k = 1; foreach $slide (@slides){ # make a new slide my $s = $pres -> Slides->Add($slideIndex,$slides[$k]->Layout) $slides[$k]->Copy; #get what you want $s->Paste; #save it $slideIndex++; $k++; }
      I always forget the details of the PPT DOM details.
        Thank you for all your help, and I am sorry that I am having such a hard time getting this, but your last fix really helped out. I now get slides that are added, and that are the correct layout, but no text? The error I get is Win32::OLE(0.1502) error 0x80048240 in METHOD/PROPERTYGET "Slides" at line 259 Win32::OLE(0.1502) error 0x80020003: "Member not found"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://600551]
[Eily]: I'm programming in python
[Eily]: I think I'm doing something like 3-4 google searches for each line that I write
[Eily]: I feel so efficient :D
[Eily]: (and it's not perl, where one line can do more than one thing at once...)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2018-05-22 15:02 GMT
Find Nodes?
    Voting Booth?