Hide and Unhide objects

H

Hari Prasadh

Hi,

How do I programmatically hide and unhide let's say an object with Name
"MRMATE001" etc. The said object could be a text-box or it could be a
ExcelOLEChart or ExcelOLEWorksheet etc.

I tried the Intelliprompt and Help for Hide and Unhide but couldnt come up
with anything.

Strangely I couldnt see the Hide/Unhide feature available in PPT menu itself
as thought I would record a macro of the said actions.

Thanks a lot,
Hari
India
 
D

David M. Marcovitz

ActivePresentation.Slides(2).Shapes("MRMATE001").Visible = False

This will hide the named shape on the second slide. If it is on a
different slide, use a number other than 2. If it has a different name,
put a different name between the quotes. If you want to unhide it, change
False to True.

Example 6.4 on my site shows a simple example of hiding and showing
shapes within PowerPoint:

http://www.loyola.edu/education/PowerfulPowerPoint/

--David
--
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.loyola.edu/education/PowerfulPowerPoint/
 
B

Brian Reilly, MVP

Alternatively to David's suggestion you could toggle the shape by
attaching this macro to another shape's mouse click or mouse over

With ActivePresentation.Slides(1).Shapes("oval 5")
.Visible = Not .Visible
End With

Brian Reilly, MVP
 
L

Laura

Hi Brian,

I was hoping you could answer a really bonehead question. I'm attempting to
do something like this but without vbscript. Basically I have a text box that
that has a custom animation applied to it that is triggered by the onclick of
another text box. This works well with getting it to display onClick. The
problem that I'm running into is that I have six of these all on the same
slide and when one text box overlaps the other, the onclick action doesn't
work. But it completely works with just an image without any layering
problems. Not sure if this is your expertise, but I thought I'd give it a
shot.

Thanks!
Laura
 
B

Brian Reilly, MVP

Laura,
That's not a bonehead question at all. I've always had problems with
shapes that overlap. That's one good reason to use VBA. But if you are
not going to use VBA, you might want to use the mouse over action
setting rather than the mouse click event (or both). The mouse over
can be much more accurate than requiring it to actually be clicked.

Brian Reilly, MVP
 
L

Laura

Thanks for answering so quickly. I can't change it to mouseover as I'm not
using the action settings. I'm using custom animation with triggers and can
only use onClick, with previous, or after previous. I can't use actions as
I'm not hyperlinking to another slide or running any macros/programs. I've
tried to VBscript method that you've suggested in other posts and couldn't
get the text box to display properly. I ended up just making these text popup
images as a last resort. I love how powerpoint forces us to bandaid
everything we need to do.

Thanks for your help.
Laura
 

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