Checkbox to hide a picture

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have inserted several pictures into PowerPoint, all of which have
transparent backgrounds. I have also added several Check-boxes into the
presentation.
I was hoping that a user could, whilst in the slideshow viewer, click any
combination of the tickboxes and the relevant pictures would be either hidden
from view or displayed. Rather like a series of layers. Since they are all
transparent, you can see through all of them to the background.

The checkbox lniks through to some VBA code...but I cannot figure out what
code I should be putting in. Using the Macro recorder, the following was
suggested...but it didn't work. I could put an "If Checkbox = TRUE" around
it if required. Any ideas how I could make it work?

ActiveWindow.Selection.SlideRange.Shapes("Picture 7").Select
With ActiveWindow.Selection.ShapeRange
.Height = 0#
.Width = 0#
.PictureFormat.CropLeft = 113.38
.PictureFormat.CropRight = 113.38
.PictureFormat.CropTop = 28.34
.PictureFormat.CropBottom = 28.34
End With
 
I have inserted several pictures into PowerPoint, all of which have
transparent backgrounds. I have also added several Check-boxes into the
presentation.
I was hoping that a user could, whilst in the slideshow viewer, click any
combination of the tickboxes and the relevant pictures would be either hidden
from view or displayed. Rather like a series of layers. Since they are all
transparent, you can see through all of them to the background.

If you are using PowerPoint 2002 or 2003, you don't need VBA code for this.
You can use trigger animations to make the pictures visible and invisible.
(And even fake a box being ticked, if necessary.)

Kind regards,
Ute
 
Unfortunately, I am using PowerPoint 2000! Sorry, I neglected to put this in
my original post...any more info or help?
 
Rich, this is not tested and there may be an easier way, but off the
top of my head, try modeling something like this in the module.

You'll have to adjust the code for the name of your checkboxes and name
of your pictures.

Private Sub CheckBox1_Click()
With ActivePresentation.Slides.Range.Shapes("Picture 4")
If CheckBox1 = True Then
.Visible = True
Else
.Visible = False
End If
End With
End Sub

-Charles
 
Thanks for the solution. It did not work, but instead I used the following.
Might not be the pretiest, but it does seem to do the job!

Set myDocument = ActivePresentation.Slides(4)
If CheckBox2 = True Then
With myDocument.Shapes(3).PictureFormat
.CropLeft = 4 * 28.3464567
End With
Else
With myDocument.Shapes(3).PictureFormat
.CropLeft = 22 * 28.3464567
End With
End If
 
Back
Top