Generating Powerpoint Slideshow w/Tables (1 Viewer)

padlocked17

Registered User.
Local time
Today, 16:58
Joined
Aug 29, 2007
Messages
276
Alright everyone. I've got some code workin quite well that is is the beginning stages of pulling data from the database and then making a Powerpoint Slide.

I've got a recordset created that is pulling from a table, but what I need to do is two-fold:

1) Create a recordset that pulls from multiple tables (Almost like a query. I haven't looked into this yet, but I need to do it)

2) Create a set number of slides that display's a pre-defined list of headers and columns and then automatically populates the rest of the table's cells if information is applicable.

To start I want three slides that display information based on calculated date criteria. There is a date entered in for each student and I want to calculate if that month is 18 months or more from a date entered for the first slide, between 15 and 17 months for the second slide, and between 12 and 14 months for the third slide.

I'm using the following code and it's well commented if someone wants to steal if for future use:

Code:
Sub cmdPowerPoint_Click()
    Dim db As Database, rs As Recordset
    Dim ppObj As PowerPoint.Application
    Dim ppPres As PowerPoint.Presentation
    
    On Error GoTo err_cmdOLEPowerPoint
    
    ' Open up a recordset on the Employees table.
    Set db = CurrentDb
    Set rs = db.OpenRecordset("tblStudents", dbOpenDynaset)
    
    ' Open up an instance of Powerpoint.
    Set ppObj = New PowerPoint.Application
    Set ppPres = ppObj.Presentations.Add
    
    ' Setup the set of slides and populate them with data from the
    ' set of records.
    With ppPres
        While Not rs.EOF
            With .Slides.Add(rs.AbsolutePosition + 1, ppLayoutTitle)
                .Shapes(1).TextFrame.TextRange.Text = "Hi!  Page " & rs.AbsolutePosition + 1
                
                'Specifying the transition that we will use for each slide
                .SlideShowTransition.EntryEffect = ppEffectFade
                
                ' Specifying that we want to advance the slides automatically
                .SlideShowTransition.AdvanceOnTime = True
                
                ' Specifying that we want the slides to advance every 3 seconds
                .SlideShowTransition.AdvanceTime = 3
                
                With .Shapes(2).TextFrame.TextRange
                    .Text = CStr(rs.Fields("LastName").Value)
                    .Characters.Font.Color.RGB = RGB(255, 0, 255)
                    .Characters.Font.Shadow = True
                End With
                .Shapes(1).TextFrame.TextRange.Characters.Font.Size = 50
            End With
            rs.MoveNext
        Wend
    End With

    ' These items specify that we want to used the Slide Show Timing specified above and to loop
    ' until the user stops the loop
    With ppPres.SlideShowSettings
        .RangeType = ppShowSlideRange
        ' Only use the following if you want specific slides to be shown
        '.StartingSlide = 2
        '.EndingSlide = 4
        .AdvanceMode = ppSlideShowUseSlideTimings
        .LoopUntilStopped = True
        '.Run
    End With
     
    ' Save the presentation to a file.  If used comment out the .Run line above
    'ppPres.SaveAs "C:\Documents and Settings\williamsn\Desktop\YourFileName.ppt", ppSaveAsPresentation
    
    ' Run the show.  This command replaced with the .Run above
    ppPres.SlideShowSettings.Run

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

Guus2005

AWF VIP
Local time
Today, 22:58
Joined
Jun 26, 2007
Messages
2,645
If there is a questions somewhere hidden in the text, please let us know.
 

padlocked17

Registered User.
Local time
Today, 16:58
Joined
Aug 29, 2007
Messages
276
I'm even open to displaying the information in another manner, it's just that a table seems like it would be the easiest. I've found where I can create a table on a slide with a predefined number of cells (rows and columns) but nothing on adding rows based on available data.
 

padlocked17

Registered User.
Local time
Today, 16:58
Joined
Aug 29, 2007
Messages
276
I found these examples (attached) that show importing almost exactly how I want only from within Powerpoint.

I need a little help converting the code to MS Access and then pulling the data how I want it.

I'll be 100% honest and say that I don't have any idea where to go from here, but could really use some help on this topic.
 

Attachments

  • PPTDisplay.zip
    353.3 KB · Views: 180

padlocked17

Registered User.
Local time
Today, 16:58
Joined
Aug 29, 2007
Messages
276
Bumping this back up. Still looking for someone with some knowledge.
 

Rabbie

Super Moderator
Local time
Today, 21:58
Joined
Jul 10, 2007
Messages
5,906
I think we are all a bit unsure what your query is. please enlighten us
 

padlocked17

Registered User.
Local time
Today, 16:58
Joined
Aug 29, 2007
Messages
276
All I'm looking to do is:

a) figure out how to create a table on a powerpoint slide that is dynamic in the fact that a row will be added for each entry that we pull from the database

b) filter the information that is placed in that table on a powerpoint slide

c) if more than 15 records fit a set of specified criteria, a second slide will be created that acts as a continuation of the first (So that data on the powerpoint presentation doesn't get small)

I just can figure out how to create a table on a powerpoint slide from within Access using VBA.
 

Users who are viewing this thread

Top Bottom