Re: Reference Controls on a Slide
- From: Steve Rindsberg <abuse@xxxxxxxxxxxxx>
- Date: Mon, 19 Jun 2006 16:40:07 EDT
In article <1150731049.946564.248470@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, FireGeek
wrote:
Steve Rindsberg wrote:
In article <1150428518.515527.60710@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, FireGeek
wrote:
I am looking for a way to reference controls on any particular slide in
PowerPoint. For example, I would like to place check boxes on a slide
and depending on which check box is checked, I would like a label to
become visible with text in it. I am planning on having several slides
to function in this manner so I need to know how I can reference these
check boxes on a particular slide.
Simplest thing is to give each shape a name. Then for a shape on, say, slide
12 you can do [aircode]:
Dim oSh as Shape
Set oSh = ActivePresentation.Slides(12).Shapes("MyShapeName")
' and to change its value, assuming it's a checkbox
oSh.OLEFormat.Object.Value = False
' and set its Visible property to false to if you like
To name a shape manually, select it then run:
ActiveWindow.Selection.ShapeRange(1).Name = "whatever you like here"
By giving the shape easily identifiable names (ie, all checkboxes start with
"chk"), you could do something like:
Dim oSl as Slide
Dim oSh as Shape
For Each oSl in ActivePresentation.Slides
For Each oSh in oSl.Shapes
If Left$(oSh.Name,3) = "chk" Then
' it's a checkbox, do your thing
End If
Next
Next
Also, how can I alter the properties of these check boxes at the
beginning of the Power Point slide show? For example, I need to
reference all check boxes and make sure their values are set to false
and the associated labels are invisible.
Any assistance would be greatly appreciated.
Thanks,
Tammy
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
THANKS STEVE for your help. I am still looking to find out how can I
alter the properties of these check boxes at the beginning of the Power
Point slide show? For example, I need to
reference all check boxes and make sure their values are set to false
and the associated labels are invisible.
Any ideas? Anyone?
Tammy
To do *anything* to every shape on each slide, you start with:
Dim oSh as Shape
Dim oSl as Slide
For Each oSl in ActivePresentation.Slides
For Each oSh in oSl.Shapes
' do your stuff here.
If oSh.Type = msoOLEControlObject Then
' you might add an extra check here, like
' If Left$(oSh.Name,5) = "Check" Then ...
.Value = False
.Visible = False
End If
Next
Next
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
.
- References:
- Reference Controls on a Slide
- From: FireGeek
- Re: Reference Controls on a Slide
- From: Steve Rindsberg
- Re: Reference Controls on a Slide
- From: FireGeek
- Reference Controls on a Slide
- Prev by Date: Re: Can blank.pot be my solution?
- Next by Date: Re: downloading a powerpoint off of a cd
- Previous by thread: Re: Reference Controls on a Slide
- Next by thread: Re: Reference Controls on a Slide
- Index(es):
Relevant Pages
|