PDA

View Full Version : Slide shown only between certain hours



markh1182
05-12-2008, 07:28 AM
Hi, Does anyone know if it is possible to only show a slide in a presentation between certain hours of the day?

I want to be able to have a presentation with say 10 slides, of which 1 will only show between the hours of 7 and 11am.

These would be running on a continuous loop on a plasma screen.

John Wilson
05-12-2008, 08:29 AM
It's definitely possible but you will need to be able to code fairly well.

You'll need to write an add in ideally, with an event handler to fire code on next slide event.

The code would need to use select case on Left$(Time$,2) to check the time and hide / unhide the slide in question.

markh1182
05-12-2008, 08:46 AM
I've not coded in Powerpoint, only in Word and Excel. Can you provide me with a start or any good samples to get me going?

Thanks, Mark

John Wilson
05-12-2008, 09:31 AM
There's a start on events in PowerPoint here
http://vbaexpress.com/kb/getarticle.php?kb_id=327

You would probably want to use the SlideShowNextSlide event to trigger code like this

Sub checktime()
Select Case Left$(Time$, 2)
Case 7 - 10
ActivePresentation.Slides(xx).SlideShowTransition.Hidden = False
Case Else
ActivePresentation.Slides(xx).SlideShowTransition.Hidden = True
End Select
End Sub

markh1182
05-14-2008, 06:25 AM
thanks, I will take a look at these.

John Wilson
05-14-2008, 08:39 AM
Should be
Val(Left$(Time$, 2))
BTW

John Wilson
05-14-2008, 09:25 AM
Sorry double post

markh1182
05-15-2008, 02:48 AM
I can get your code to hide a slide working.

But I can not get the class events module to work, either as per the example you gave the link for or to NextSlide event.

This is my Class Module called cEventClass:

'#######################################################
'### EventClass code
'#######################################################
'declares a variable that will handle application events
Public WithEvents PPTEvent As Application

Private Sub PPTEvent_SlideShowNextSlide(ByVal Wn As SlideShowWindow)
MsgBox "Next Slide"

End Sub


This is my code in a normal Module:

'#######################################################

'#######################################################
'### Standard module code
'#######################################################
'declare an object that will create a new instance of the event class
Public cPPTObject As New cEventClass

Sub Auto_Open()

Set cPPTObject.PPTEvent = Application
MsgBox "Auto Open"

End Sub


Once I save this as an add-in I do get the MsgBox for saying "Auto Open" but not the one in my class for "Next Slide" when I view the Slide Show.

ps I'm using Powerpoint 2000

John Wilson
05-15-2008, 03:11 AM
Hi

Your code works for me. What version do you have?

markh1182
05-15-2008, 03:49 AM
I'm using Powerpoint 2000

John Wilson
05-15-2008, 07:22 AM
I'll check out your code in 2000 and get back. I'm pretty sure that the SlideShowNextSlide event is supported though.

John Wilson
05-15-2008, 07:26 AM
Worked fine in 2000 as well! Maybe you could mail me your ppa file. You'll find my email on the contact pages of PowerPoint Alchemy

markh1182
05-22-2008, 06:56 AM
Hi John, I have emailed you my ppa file and the original ppt file.

Thanks, Mark

John Wilson
05-23-2008, 10:54 AM
Thanks I got it

Unfortunately it works fine here too in all versions I have 2000-2007. The next slide message fires every time.

Don't know what else to suggest except try a different PC / version

John

markh1182
05-30-2008, 05:51 AM
thanks for your help John.