
Signature
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
thomas.schoenfelder@cyberfun.de wrote in news:1140467618.334978.254950
@g43g2000cwa.googlegroups.com:
Dave,
Thanks a lot, you saved my day
Now it works :-))))
Now to be flexible on the number of slides I want to use a Variable
(SL_Name) instead of Slide1 ... Slide9
something like this...
"
Sub Cancel_Joker()
NrSlides = ActivePresentation.Slides.Count
For i = 1 To NrSlides
SL_Name = ActivePresentation.Slides(i).Name
SL_Name.Button_5050_1.Picture = LoadPicture("MyPic.jpg")
Next i
End Sub
"
How do I need to define/use this variable (SL_Name) to make this code
work
regards
Thomas
David M. Marcovitz - 20 Feb 2006 21:30 GMT
I was afraid you were going to ask that. I don't know the answer.
Hopefully, one of the more advanced VBA experts will chime in with an
answer.
--David

Signature
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
thomas.schoenfelder@cyberfun.de wrote in news:1140469994.859717.31550
@g44g2000cwa.googlegroups.com:
> Dave,
> Thanks a lot, you saved my day
[quoted text clipped - 23 lines]
>
> Thomas
Steve Rindsberg - 21 Feb 2006 01:56 GMT
How about this:
Dim oSl as Slide
For Each oSl in ActivePresentation.Slides
With oSl.Shapes("CommandButton1")
.OLEFormat.Object.Picture = LoadPicture("c:\pix\yourpicture.jpg")
End With
Next
If you can get an object reference to the shape that represents the control
(button, textbox, whatever) then tack on .OLEFormat.Object and carry on as
though you're setting properties in the control's property sheet or click event
handler.
> Dave,
> Thanks a lot, you saved my day
[quoted text clipped - 23 lines]
>
> Thomas
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
thomas.schoenfelder@cyberfun.de - 21 Feb 2006 21:36 GMT
Steve,
thanx a lot, your fix works great.
that's exactly what I was after.
best regards
Thomas