VBA code in slide show mode

G

Guest

Looking for help with VBA coding..........spent many hours trying to get the
code working without success.

Objective: I have a slide with a floor plan that has several shapes (an
arrow) scattered through out the plan. The idea is that when the user clicks
on the shape it brings up a picture of that area in the centre of the slide
and when they click on the picture it then disappears. If I use the
hyperlinks feature the problem is that the image comes in at full size and
the user has to reduce the zoom effect.
I found some examples of a popup image and shapes alternate text feature
routines at the web site http://www.rdpslides.com that works well.

The probelm is how do I add code so that when the shape is clicked the code
looks at the alternate text property of the shape being clicked (this will
give the link to the picture file) to display the picture.

Any help would save my sanity.

Thanks

Paul
 
S

Steve Rindsberg

The probelm is how do I add code so that when the shape is clicked the code
looks at the alternate text property of the shape being clicked (this will
give the link to the picture file) to display the picture.

Assign an action setting of Run Macro, DoTheThing (or whatever you want to call
it) to each shape and make sure this macro's in the ppt file:

Sub DoTheThing(oSh as Shape)
MsgBox oSh.AlternativeText
End Sub

That gets you the alt text. The rest is up to you. Use the power wisely. ;-)
 
G

Guest

Many thanks for the reponse Steve.

I got the msg window to open showing the alternative text and put line line
is the code below. Got myself in a right mess though. Help

Thanks.

Sub PopupNew1(oSh As Shape)

Dim oPopupNew As Shape
Dim oSl As Slide
Dim dOffset As Double
Dim TempImage As String

Set oSl = oSh.Parent

TempImage = oSh.AlternativeText

Set oPopupNew1 = oSl.Shapes.AddPicture(TempImage, msoFalse, msoTrue,
200, 100, 400, 300)

With oPopupNew1

.ActionSettings(ppMouseClick).Run = "Delete"
End With

ActivePresentation.SlideShowWindow.View.GotoSlide (oSl.SlideIndex)

End Sub
 
S

Steve Rindsberg

Many thanks for the reponse Steve.

I got the msg window to open showing the alternative text and put line line
is the code below. Got myself in a right mess though. Help

What's not working?
I notice that you did Dim oPopupNew as Shape but then you use oPopupNew1 when you
add the picture.
 
G

Guest

Many thanks Steve.............it worked.
Boy do I feel stupid though, I've been staring at that mistake for quite a
while now.

Again Thanks
 
S

Steve Rindsberg

Many thanks Steve.............it worked.
Boy do I feel stupid though, I've been staring at that mistake for quite a
while now.

No worries. Glad it was that easy to sort out!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top