Powerpoint VBA Code for 'Is Shape Displayed?'


G

Guest

Hello,

I am trying to generate some VBA Macro code to determine if a particular
shape / text box etc is visable on screen during a slideshow.

I have been able to do this if the shape's .visible property is set to false
or true by code itself:

Example:

Dim ShapeVisible As Boolean

ActivePresentation.Slides(2).Shapes.Item("Rectangle 123").Visible = msoFalse

ShapeVisible = ActivePresentation.Slides(2).Shapes.Item("Rectangle
123").Visible = msoFalse

If ShapeVisible Then

......... Rest of Code

EndIf


However, what I really need to do now is determine if a shape which has been
set to appear / disappear by custom animation is 'on screen'(after appear) or
'off screen' (after Disappear).

Is this possible, as the shape's .visible property always seems to be 'True'
irrespective of the Appear / Disappear animation?

Thanks for you help,

Ian
 
Ad

Advertisements

S

Shyam Pillai

Hello Ian,
The visible property is not related to the animation properties. It's a
state of the shape when not animated.
To determine the current *animated* state one needs to read the animation
information and then keep track of the animation timeline. Not a trivial
task but it can be done with some amount of the code and some event handling
to keep track of the animations that have fired. Let me know if you need
more information.


--
Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm
 
G

Guest

Shyam,

Thank you for your quick response. Your suggestion sounds exactly like the
route I need to take! Without wishing to take up too much of your time, have
you got any pointers on where to go for further information on how to
proceed.

I obviously have access to the Powerpoint VBA Help files which has some
information on Event Handling. Any advice on tracking the timeline and
animations triggered by mouse clicks would be very useful.

Thanks again

Ian
 
S

Shyam Pillai

Ian,
Head to this page: Timeline – The animation engine in PowerPoint -
http://skp.mvps.org/ppttimeline1.htm. This explains how to read animation
information in PPT 2002/2003/2007.

By trapping events of SlideShowNextBuild (available PPT 2003/2007),
SlideShowNextClick. You should be able to keep track of where the user is in
a given slide.

Get back if you have any further questions.

--
Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm
 
Ad

Advertisements

G

Guest

Shyam,

Thank you for your help. Problem now solved by trapping SlideShowNextBuild
Events, and counting them.

Code now does exactly as I needed it to

Ian
 

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