Solved

Display PowerPoint in Access 2007 Form with Transitions

Posted on 2011-03-21
9
604 Views
Last Modified: 2012-06-27
I am using Access 2007 to create a kiosk application.  The main screen has an embedded powerpoint presentation which i have been able to automate so that it will play every x seconds.  I also have buttons that will do next, stop and previous so the user can easily navigate if they want to relook at a slide (typically advertisments)  The issue now is purely asthetics.  I would like the transitions to show and currently they do not.  I had to put an echo command in to elimiante the screen from going blank as it reloaded a slide.  I am happy where i am at but i know that the users would perfer to have the transitions that you get in powerpoint to display on the kiosks.
Private Sub Form_Load()
    On Error GoTo insertShow_Click_Error
    
    ' Open PowerPoint
    Dim strPowerPointFile As String
    Dim pptobj As PowerPoint.Application
    Set pptobj = New PowerPoint.Application
    pptobj.Visible = True
    pptobj.WindowState = ppWindowMinimized
    
    strPowerPointFile = "C:\Users\me\desktop\file.pptx"
    
    ' Fill a collection with all Slide IDs.
    With pptobj.Presentations.Open(strPowerPointFile)
        Set mcolSlideIDs = New Collection
              Dim ppSlide As PowerPoint.Slide
        For Each ppSlide In .Slides
            mcolSlideIDs.Add ppSlide.SlideID
        Next
        .Close
    End With
    
    ' Close PowerPoint
    pptobj.Quit
    Set pptobj = Nothing

    ' Make object frame visible and enable "navigation" buttons.
    pptFrame.Visible = True
  ' FirstSlide.Enabled = True
    'lastSlide.Enabled = True
    'nextslide.Enabled = True
   ' previousSlide.Enabled = True

    ' Specify OLE Class, Type, SourceDoc, SourceItem and other properties.
    With pptFrame
        .Class = "Microsoft Powerpoint Slide"
        .OLETypeAllowed = acOLELinked
        .SourceDoc = strPowerPointFile
                 

    End With
    SetSlide 1
    
     
    Exit Sub

insertShow_Click_Error:
    MsgBox Err.Number & " " & Err.Description
    Exit Sub
End Sub

Open in new window

0
Comment
Question by:thwinward
  • 5
  • 4
9 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35184789
Why the need for the MS Access "Container"?
IMO, it just seems like too many machinations to get this custom functionality...

To do what you are asking it would seem that you would also need to specify the Transition, so see here:
http://msdn.microsoft.com/en-us/library/aa221452%28v=office.11%29.aspx


Why not save the PP file as a  "Show" ("YourFile.ppsx")
Then simply open it from within Access using code similar to this:

    Application.FollowHyperlink "c:\YourFolder\YourFile.ppsx"


Or just run the PP show directly in Kiosk mode without MS Access?

JeffCoachman
0
 

Author Comment

by:thwinward
ID: 35185433
The idea was that i have a form that has a card swipe input at the top and the PPT is playing in a window within the form vs full screen mode so it is in an unbound framed object.    The code given above would work if i was running PPT standalone but not from the framed object.  
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35185626
Then I know of no easy way to do this.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

Author Comment

by:thwinward
ID: 35186058
The only thing i am seeing now is that when in full screen maximized mode i am getting a lot of flickering is there an easy way to stop the screen refreshing from doing this?  I was wondering if you could play a pps in a internet exploer active X window...
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35186108
In Access you can turn of the screen before the flicking:

    Application.echo False

Then turn it back on afterwards:
   
    Application.echo True

I'm just guessing, ...but it might be something like this in your code.

For Each ppSlide In .Slides
    Application.echo False
    mcolSlideIDs.Add ppSlide.SlideID
    Application.echo True
Next

Here my guess is that before the slide is added, turn off the screen
then after it is added turn the screen back on.


I see that you posted code with error handling...
That's good because in the event of any error you want to "immediately" turn the screen back on.
If not, ...real "Weirdness" will occur...
:-O

insertShow_Click_Error:
    Application.echo True
    MsgBox Err.Number & " " & Err.Description
    Exit Sub


JeffCoachman
0
 

Author Comment

by:thwinward
ID: 35186276
OK so maybe the powerpoint isn't the answer:)   What is the easiest way to embedd a AVI or MP4 Video into a form in your opinion?
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 35186695
Insert the MS Media player in a form.

Then use code like this to play a file:

Dim strFile As String
strFile = "C:\Documents and Settings\user\My Documents\My Music\SomeVideo.avi"
Me.objWMP.Object.URL = strFile

I am not sure that WMP supports playing all avi and mp4 files natively, ... you may have to download a codec
See here for more info:
http://support.microsoft.com/kb/316992

I'm still using WMP 9, the current version is 12 so these types may very well be supported...




0
 

Author Closing Comment

by:thwinward
ID: 35186735
I think i may have being trying to square peg a round hole so your comments gave me the guidance i needed.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35186772
;-)
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question