Consulting

Results 1 to 4 of 4

Thread: Use Access VBA to create an action button in Powerpoint??!

  1. #1
    VBAX Regular
    Joined
    Oct 2013
    Posts
    17
    Location

    Use Access VBA to create an action button in Powerpoint??!

    Hi,

    I am using VBA in Access 2013 to make a PowerPoint presentation using data from the access database. Does anyone know if it is possible to use Access VBA to create a button in the presentation that runs a procedure itself? I'm not sure how to go about it if it is possible so any help would be appreciated! Thanks.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    It would be possible but post the code you have to create the presentation and slide to contain the button. I am presuming the proc is in the PPT presentation?
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Oct 2013
    Posts
    17
    Location
    This is the code I am using to make the powerpoint and create a slide:
            Dim db As Database, rs As Recordset
            Dim ppObj As PowerPoint.Application
            Dim ppPres As Powerpoint.Presentation
            Dim pptSlide As Slide
            Dim pptLayout As CustomLayout
    
    
            db = CurrentDb
            rs = db.OpenRecordset("*******", dbOpenDynaset)
    
    
            ppObj = New PowerPoint.Application
            ppPres = ppObj.Presentations.Add
            With ppPres
                .PageSetup.SlideHeight = 540
                .PageSetup.SlideWidth = 720
                While Not rs.EOF
                    With .Slides.Add(rs.AbsolutePosition + 1, ppLayoutLargeObject)
                        .SlideShowTransition.Hidden = msoTrue
                        .FollowMasterBackground = False
                        .Background.Fill.Solid()
                        .Background.Fill.ForeColor.RGB = RGB(0, 0, 0)
                        With .Shapes(1).TextFrame.TextRange
                            .Text = "*******"
                            .Characters.Font.Color.RGB = RGB(255, 255, 255)
                            .Characters.Font.Size = 36
                            .ParagraphFormat.Bullet = False
                            .ParagraphFormat.Alignment = ppAlignCenter
                        End With
                    End With
                End While
            End With
    I'm hoping to include the procedure in Access as the presentations are made each time and not saved and all the code is in my Access database. I want to add a button that will set up custom slide shows once the user has made some changes. At the moment I am making the custom slide shows through the VBA in Access and having to edit them manually when slides are added to the presentation by the user.

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    To the best of my knowledge the action button could ONLY run code in the PowerPoint presentation.

    If it was me I think I would put all the code in a PPT AddIn with ribbon buttons to add the presentation from access and then another button to make the custom shows. Not a trivial task but I think more satisfatory.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •