PDA

View Full Version : relatively simple question: referring to an object on a slide in a powerpoint Add-in



Bruinlax
11-11-2008, 01:41 PM
Hi - i'm trying to use the Pickup method on an object that is on the first slide in an add-in i've created.

I'm still new to ppt Vba - so i can't seem to find a way to reference to the shape

presentations("myaddin.ppa").slides(1).shapes("test").pickup

doesn't work when the ppa is saved and loaded. . .

Any suggestions? I'm hoping this is an easy one.

Demosthine
11-11-2008, 03:11 PM
Good Afternoon.

You may want to try ActivePresentation rather than explicitely defining the name. If the User changes the name for any reason, it will error out.


ActivePresentation.Slides(1).Shapes("Test").Pickup


If this doesn't work, please post your Add-In so that we can answer a little better.

Scott

Hope this helps.

Bruinlax
11-11-2008, 07:36 PM
The issue is i want to do the pickup method on a specific object in the addin, and then apply it objects with a specific tag in the activepresentation.

here's what i would have done.

Sub Doit()
Dim oSl As Slide
Dim oSh As Shape
Dim addinname As String
addinname = "pptdoempkelinkv5.pPT"
Presentations(addinname).Slides(1).Shapes("test").PickUp
For Each oSl In ActivePresentation.Slides
On Error Resume Next
Set oSh = oSl.Shapes("Watermark1")

oSh.Apply
next osl

end sub

John Wilson
11-12-2008, 01:17 AM
The problem is that when you save as a ppa addin the slides are NOT included just the code so your idea will not work.

Bruinlax
11-12-2008, 11:42 AM
that's what it seemed like. Thanks. Time to think of another solution.