PDA

View Full Version : How to set an application invisible when one silde start?



woodyChen
10-10-2013, 07:26 AM
I need to set the Flash invisible when one slide begin, and when I click a button, the Flash appear.

I know the second step is
Private Sub CommandButton1_Click()
shockwaveflash1.visible=true
End Sub

But what's the first step, what should I do to make the FLASH invisible at first?
Cannot do this in the propotion window, IF I set the visible=false in the proportion window, and I play the slide, click the button to make it visible, then the next time I play the slide, the Flash is visible again for it have been change when i run the click-button sentence.

So what I need is a sentence to set the shockwaveflash1.visible=false every time I started playing the slides. what is that, and where should I put it?(I have tried writing "shockwaveflash1.visible=false " in the vba window, but it didn't work)


Sorry for my poor English, I dont know if I express problem clearly, and thanks in advance.

John Wilson
10-10-2013, 08:45 AM
I would suggest NOT using a command button. Use a normal shape or Action Buttion with an action of run Macro (startup)

CODE


Sub startup()
Dim osld As Slide
Set osld = SlideShowWindows(1).View.Slide
With osld.Shapes("shockwaveflash1").OLEFormat.Object
.Visible = True
.Playing = True
End With
End Sub

Sub killIt()
Dim osld As Slide
Set osld = SlideShowWindows(1).View.Slide
With osld.Shapes("shockwaveflash1").OLEFormat.Object
.Visible = False
.Playing = False
End With
End Sub

Sub OnSlideShowPageChange(SW As SlideShowWindow)
'NOTE if not on slide 1 change the number
If SW.View.CurrentShowPosition = 1 Then Call killIt
End Sub