> 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
[quoted text clipped - 6 lines]
>
> Tammy
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
FireGeek - 19 Jun 2006 16:30 GMT
> > 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
[quoted text clipped - 46 lines]
> 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
Steve Rindsberg - 19 Jun 2006 21:40 GMT
> > > 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
[quoted text clipped - 56 lines]
>
> 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
================================================
Hi,
Check this out:
Reference an ActiveX control on a slide in VBA
http://skp.mvps.org/ppt00042.htm

Signature
Regards,
Shyam Pillai
Toolbox: http://skp.mvps.org/toolbox
>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
[quoted text clipped - 13 lines]
>
> Tammy