Access/VBA Library


Inserts a presentation as an embedded object at the active slide. The embeded presentation will start after a mouse-click or directly, depening on the StartDirectly parameter.


EmbedPresentation( Filename [, StartDirectly] )
Name Type Description
Filename String Required. Name of the presentation to embed.
StartDirectly Boolean Optional. Indicator if the presentation should start directly.
Default: False
Public Sub EmbedPresentation(Filename As String, Optional ByVal StartDirectly As Boolean = False)
    Dim NewShape As Shape
    If ActiveSlide Is Nothing Then Exit Sub
    With ActiveSlide
        Set NewShape = .Shapes.AddOLEObject(200, 100, Filename:=Filename, _
                                            DisplayAsIcon:=msoFalse) = FSO.GetBaseName(Filename)
        With NewShape.AnimationSettings
            .Animate = msoTrue
            If StartDirectly Then
                .AdvanceMode = ppAdvanceOnTime
                .AdvanceMode = ppAdvanceOnClick
            End If
            .AdvanceTime = 0
            .EntryEffect = ppEffectNone
            ' Unfortunally this has no effect, it would be nice
            ' when the presentation will hide after animation.....
            .AfterEffect = ppAfterEffectHide
            .AnimateBackground = msoFalse
            With .PlaySettings
                .PlayOnEntry = msoTrue
                .HideWhileNotPlaying = msoTrue
            End With
        End With
    End With
End Sub