Full Version: play animated powerpoint on access form
UtterAccess Forums > Microsoft® Access > Access Forms
I've seen this code to play a powerpoint movie manually on access forms
this code
This does not seem to autoplay an animated powerpoint slideshow on timers.
Basically I'd like to be able to play an animated/timed powerpoint on an access form.
Can anyone help me with this ?
Thanks !
Candace Tripp
Set the OLEBound that contains the PPT file AutoActivate property to GetFocus.
Option Compare Database
Option Explicit
    Private m_lngTickCount As Long
Private Sub Form_Load()
    m_lngTickCount = 0
    Me.TimerInterval = 1000 ' 1 second
End Sub
Private Sub Form_Timer()
    m_lngTickCount = m_lngTickCount + 1
    Me.txtTimerInterval = m_lngTickCount
    If m_lngTickCount = 20 Then ' after 20 seconds
        Me.TimerInterval = 0
    End If
End Sub
Thanks very much Candace.

I have 2 slides - one with a text intro on a 2 sec timer and the next slide has an avi video on it which autoplays after previous. The 1st slide plays fine on the form but it does not move to the 2nd with the movie on it.

In other words, does the above code work with a slideshow that has a movie on it ?
Edited by: Roland on Tue Jun 13 17:11:52 EDT 2006.
Candace Tripp
Google is your friend.
But WHERE into PowerPoint?
Well yes. That's the real question, isn't it? Here's how you use VBA code in PowerPoint:
Open a PowerPoint presentation.
Choose Tools, Macro, Security and set security to Medium. Otherwise, PowerPoint will disable your macros the next time you open the file that contains them. With security set to Medium, PowerPoint will always ask whether to enable macros or not when you open a file that contains them. We don't recommend the Low setting, since it gives no warnings.
Press ALT+F11 to start PowerPoint's VBA editor. Or choose View, Toolbars, Visual Basic to get shortcut buttons to the editor and for running macros. Or choose Tools, Macro, Visual Basic Editor to start the editor.
In the VBA editor, make sure that your presentation is highlighted in the left-hand pane. Choose Insert, Module from the menu bar to insert a new code module into your project (project = presentation in VBAspeak). Modules are one of the several "containers" that can hold VBA code.
If your code snippet already starts with "Sub XXX()" and ends with "End Sub", simply click in the new module you just inserted and paste in the code. Otherwise, you'll have to type in "Sub XXX" (where XXX is the name you want to give the subroutine (aka "macro"). When you press Enter, PowerPoint adds the parentheses and End Sub for you automatically. Then position the cursor between the Sub XXX and End Sub lines and paste in your code.
To make sure there are no serious syntax problems with the code, choose Debug, Compile from the menu bar. If there's a problem, you'll see a message explaining (well ... explaining in a geeky, obtuse way that usually won't make any sense to you) what VBA doesn't like about the code. Click OK and the problem line will be highlighted for you. Fix it and compile again until you get no error messages.
Now click the Run button (a right-facing arrowhead icon), choose Run, Run Sub/User Form from the menu bar or press F5 to run your code.
Once your code's working properly, you can run it directly from within PowerPoint without having to start the VBA editor. Choose Tools, Macros, Macros to get a list of available macros ( = subroutines, remember?) in the current presentation. Highlight the one you want to run and click Run (or simply doubleclick the one you want). You can also view and run macros from other open presentations; choose the presentation where your macro is stored from the Macros In dropdown listbox.
Thanks Candace.
My fault. I should have been more specific. The coding I'm using is fairly>intermediate level.
Oautomate Powerpoint from Access2K to create a slideshow on the fly with one slide with text from a table.
sample code here
I use a cmdbutton to find an avi, mpg, wmv using api calls
sample code here
I then insert this selected movie into a 2nd slide
sample code here
I then set slide/shape triggers, timing & animation sequences to :
autorun 1st slide >> fade in text >> fade out text >> move to 2nd (movie)slide >> maximize movie to fullsceen >> start movie
sample code here
My PP automation works fine/great on its own.
When I try to run this same slideshow on my A2K slide preview form using the code you kindly provided - the problem I am running into is that it plays Slide 1 and then halts. Could it be that Access does not like to play slideshows with movies on it ?
Thanks for your help & great code on your site.
Candace Tripp
Tried -- couldn't get it to run.
o well, i foxed the experts ?!
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.