PDA

View Full Version : vba Powerpoint, need slide timeout code...



chris italy
02-23-2010, 08:57 AM
Hi all,
I am very new to all this clever stuff....but i have dived right in at the deepend and am rewriting an entire website in powerpoint 2000 on vista/xp. It is a simple site viewed essentially as a slideshow, but with menus and categories etc.

I have figured out page counts (although i will need to revisit storage of values in case of power failure!!), but right now i am trying to get a page timeout to return to home after say 3 minutes, from any and every page selected.

The problem I have is i do not know where to put the code, and my timer is not resetting - it just starts counting then jumps to page one even if other pages have been selected in the meantime.

Does this make sense? I want to jump to page 1 after 3 mins inactivity.

This what i have so far...


Public Static Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)

Dim start, delay, centro_storico, nh_welcome 'define each individual page/advertiser


If SSW.View.CurrentShowPosition = 3 Then

centro_storico = centro_storico + 1
MsgBox "Views " & centro_storico
timeout (3)

End If

If SSW.View.CurrentShowPosition = 9 Then

nh_welcome = nh_welcome + 1
MsgBox "Views " & nh_welcome
timeout (3)


End If

End Sub
Public Static Sub timeout(delay)
' added bit for delay timeout...?
start = Timer ' Set start time.
Do While Timer < start + delay
DoEvents ' Yield to other processes.
Loop

With SlideShowWindows(1).View
.GotoSlide 1
End With
End Sub



I have tried putting start=timer or even start=0 at various points but it just will not stop!!! I am running it at 3 seconds for now until it works.

Eventually i will need around 100 slides, each counting and each returning home after inactivity.

This seems straightfoward...but i am lost!

can anyone provide a little suggestion?

thanks loads
chris

1234567890
04-10-2010, 03:02 AM
hi did you get it to work