Thanks for your help. This is working great for hiding all my shapes, but
not so great for having them reappear. I'm assuming I use the same code to
make them reappear, but just change the name of the procedure to something
like ShowMe and change the property to msoTrue. If I'm wrong then what
should I do.
What's happening for example: I hide all my triangles, ovals, and hearts
upon starting the game - the code works great. I advance to slide 2 click on
a button to have my triangles reappear and it does on slide 2. I advance to
slide 3 and it's not there until I click on the next button to have my ovals
appear. Now on slide 3 I have my triangls and ovals visible, but when I
advance to slide 4 my triangle is visible but not my oval until I click on
the button to have my hearts appear. This happens throughout the
presentation with every shape/picture. Here's the code I've tried to use.
Sub HideMe2()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
oSld.Shapes("triangle").Visible = msoFalse
oSld.Shapes("oval").Visible = msoFalse
oSld.Shapes("heart").Visible = msoFalse
oSld.Shapes("cloud").Visible = msoFalse
Next
On Error GoTo 0
End Sub
Sub ShowTriangle()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
oSld.Shapes("triangle").Visible = msoTrue
Next
On Error GoTo 0
End Sub
Sub ShowOval()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
oSld.Shapes("oval").Visible = msoTrue
Next
On Error GoTo 0
End Sub
Sub ShowHeart()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
oSld.Shapes("heart").Visible = msoTrue
Next
On Error GoTo 0
End Sub
'I've even tried something like this but still get the same results.
Sub ShowAllTriangles()
ActivePresentation.Slides(2).Shapes("triangle").Visible = True
ActivePresentation.Slides(3).Shapes("triangle").Visible = True
ActivePresentation.Slides(4).Shapes("triangle").Visible = True
ActivePresentation.Slides(5).Shapes("triangle").Visible = True
End Sub
Need a little more help.
Thanks,
Mike
> Hi Mike,
>
[quoted text clipped - 102 lines]
> > Thanks for the help
> > Mike
John Wilson - 03 Jul 2009 17:18 GMT
My guess is that PPT is predrawing the next slide before your "show" code runs.
Try putting a blank slide between all the other slides with an auto
transition of zero secs

Signature
john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
> Thanks for your help. This is working great for hiding all my shapes, but
> not so great for having them reappear. I'm assuming I use the same code to
[quoted text clipped - 174 lines]
> > > Thanks for the help
> > > Mike
Preschool Mike - 05 Jul 2009 21:35 GMT
I think you're on to something with the predraw. I tried inserting blank
slides and I'm still having the same issues. As I said my game is kind of
like a maze so there are times when the player must revisit slides previously
viewed. This is where my shapes seem to disappear, upon revisiting slides
previously viewed. They will come back however if I view a slide I've not
viewed yet and even when I revisit a slide for the 3rd time. Is there a way
to make ppt think that it's viewing each slide for the first time?
> My guess is that PPT is predrawing the next slide before your "show" code runs.
> Try putting a blank slide between all the other slides with an auto
[quoted text clipped - 178 lines]
> > > > Thanks for the help
> > > > Mike
Steve Rindsberg - 03 Jul 2009 18:13 GMT
I just posted this on the FAQ t'other day, Mike. It might apply to your
situation too:
Hide and Show Graphics
http://www.pptfaq.com/FAQ01019.htm
The idea is that when you hide something, you "tag" it as hidden so you can
later go back and make visible any shapes tagged hidden.
> Thanks for your help. This is working great for hiding all my shapes, but
> not so great for having them reappear. I'm assuming I use the same code to
[quoted text clipped - 174 lines]
> > > Thanks for the help
> > > Mike
==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/
PPTools add-ins for PowerPoint
http://www.pptools.com/
Bill Dilworth - 03 Jul 2009 18:14 GMT
Or even call a hide all and show only one...
-----
Sub HideAll()
Dim oSld As Slide
For Each oSld In ActivePresentation.Slides
oSld.Shapes("Oval").Visible = msoFalse
oSld.Shapes("Rectangle").Visible = msoFalse
oSld.Shapes("Heart").Visible = msoFalse
oSld.Shapes("Cloud").Visible = msoFalse
Next
End Sub
Sub ShowOnlyHearts()
Dim oSld As Slide
On Error Resume Next
HideAll
For Each oSld In ActivePresentation.Slides
oSld.Shapes("Heart").Visible = msoTrue
Next
On Error GoTo 0
End Sub
-----
Bill Dilworth
> Thanks for your help. This is working great for hiding all my shapes, but
> not so great for having them reappear. I'm assuming I use the same code
[quoted text clipped - 194 lines]
>> > Thanks for the help
>> > Mike
Preschool Mike - 04 Jul 2009 17:26 GMT
Getting better, but still the same problem. I've tried everything
recommended. Some work, but not perfect. Some do not. I've put a blank
slide between all my slides. That has helped, but it's not perfect. My
pictures will still hide on some slides and then reappear. Also, sometimes
they don't reappear. I'm starting to wonder if this is because of my game
design and how the player advances from slide to slide. As I said it is kind
of like a maze. From slide one the player can go in 4 directions (this is
just an example, not exact: right - slides 2 - 11, down - slides 12 - 20,
left - slides 21 - 30, and up - slides 31 - 40. The objective is to find the
shapes but in the correct order (lets say the order is star, oval, triangle,
and then heart. So lets say the player chooses to go right where they find
the triangle. Since the triangle is not the first shape in the order they
must go back each slide until they reach slide 1 (this game is also about
remembering where everything is, thus the reason to go back). They've
reached slide 1 and decide to go up where they find the star. They click on
the star and it appears in the box displaying the shapes found and they are
told what shape they have to find next. The inactive oval on slide 10 hides
and the active (the one that runs the macro for the next shape) now appears.
From here they have to go back to slide 1 and hopefully they've remembered
which direction to take to get back to the oval.
So you see it's possible they can go in 3 wrong directions before finally
finding the correct shape. Could this back and forth movement be the cause
of my problem (i.e., revisiting slides previously viewed)?
Here's my code for hiding the shapes. Note I'm not actually using the
shapes mentioned above. This code works well for hiding my shapes. Doesn't
seem to be any problems here.
Sub HideMe2()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
oSld.Shapes("walletMaster").Visible = msoFalse
oSld.Shapes("moneyMaster").Visible = msoFalse
oSld.Shapes("bananaMaster").Visible = msoFalse
oSld.Shapes("bucketMaster").Visible = msoFalse
oSld.Shapes("cupMaster").Visible = msoFalse
oSld.Shapes("eggMaster").Visible = msoFalse
oSld.Shapes("keyMaster").Visible = msoFalse
oSld.Shapes("keyhole2").Visible = msoFalse
oSld.Shapes("moneyFarm2").Visible = msoFalse
oSld.Shapes("bananaStore2").Visible = msoFalse
oSld.Shapes("bucketMountain2").Visible = msoFalse
oSld.Shapes("cupLake2").Visible = msoFalse
oSld.Shapes("eggDesert2").Visible = msoFalse
oSld.Shapes("keyJungle2").Visible = msoFalse
Next
On Error GoTo 0
End Sub
Here's my code for making them reappear along with a couple of explanations
of how things work. This is where I seem to be having problems.
Clicking on the wallet picture runs this procedure.
Sub WaterFall()
Dim oSld As Slide
On Error Resume Next
'Finding the wallet is the first picture they must find.
'When they find and click on it picture moneyFarm hides and
'picture moneyFarm2 becomes visible.
For Each oSld In ActivePresentation.Slides
oSld.Shapes("walletMaster").Visible = msoTrue
oSld.Shapes("moneyFarm2").Visible = msoTrue
oSld.Shapes("moneyFarm").Visible = msoFalse
Next
On Error GoTo 0
End Sub
Picture moneyFarm2 runs this procedure. This is the second picture they
must find.
Sub Farm()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
oSld.Shapes("bananaStore2").Visible = msoTrue
oSld.Shapes("moneyMaster").Visible = msoTrue
oSld.Shapes("bananaStore").Visible = msoFalse
Next
On Error GoTo 0
End Sub
Sub Store()
Dim oSld As Slide
On Error Resume Next
Clicking on the bananaStore2 picture runs this procedure.
For Each oSld In ActivePresentation.Slides
oSld.Shapes("bananaMaster").Visible = msoTrue
oSld.Shapes("bucketMountain2").Visible = msoTrue
oSld.Shapes("bucketMountain").Visible = msoFalse
Next
On Error GoTo 0
End Sub
bucketMountain2 runs this.
Sub Mountain()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
oSld.Shapes("bucketMaster").Visible = msoTrue
oSld.Shapes("cupLake2").Visible = msoTrue
oSld.Shapes("cupLake").Visible = msoFalse
Next
On Error GoTo 0
End Sub
Sub Lake()
Dim oSld As Slide
On Error Resume Next
cupLake2 runs this.
For Each oSld In ActivePresentation.Slides
oSld.Shapes("cupMaster").Visible = msoTrue
oSld.Shapes("eggDesert2").Visible = msoTrue
oSld.Shapes("eggDesert").Visible = msoFalse
Next
On Error GoTo 0
End Sub
eggDesert2 runs this.
Sub Desert()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
oSld.Shapes("eggMaster").Visible = msoTrue
oSld.Shapes("keyJungle2").Visible = msoTrue
oSld.Shapes("keyJungle").Visible = msoFalse
Next
On Error GoTo 0
End Sub
keyJungle2 runs this.
Sub Jungle()
Dim oSld As Slide
On Error Resume Next
For Each oSld In ActivePresentation.Slides
oSld.Shapes("keyMaster").Visible = msoTrue
oSld.Shapes("keyhole2").Visible = msoTrue
oSld.Shapes("keyhole").Visible = msoFalse
Next
On Error GoTo 0
End Sub
Thanks,
Mike
> Or even call a hide all and show only one...
>
[quoted text clipped - 224 lines]
> >> > Thanks for the help
> >> > Mike
Preschool Mike - 05 Jul 2009 16:55 GMT
> Getting better, but still the same problem. I've tried everything
> recommended. Some work, but not perfect. Some do not. I've put a blank
[quoted text clipped - 290 lines]
> > >> ----
> > >> This little routine takes moments and hides "Whatever" on all slides