Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-31-2007, 12:21 PM   #1
airforceruss
Newly Registered User
 
Join Date: Aug 2007
Posts: 259
Thanks: 1
Thanked 1 Time in 1 Post
airforceruss is on a distinguished road
Generating Powerpoint Slideshow w/Tables

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

airforceruss is offline   Reply With Quote
Old 11-01-2007, 05:49 AM   #2
Guus2005
AWF VIP
 
Guus2005's Avatar
 
Join Date: Jun 2007
Location: The Netherlands
Posts: 2,523
Thanks: 53
Thanked 85 Times in 78 Posts
Guus2005 has a spectacular aura about Guus2005 has a spectacular aura about Guus2005 has a spectacular aura about
If there is a questions somewhere hidden in the text, please let us know.
Guus2005 is offline   Reply With Quote
Old 11-01-2007, 10:02 AM   #3
airforceruss
Newly Registered User
 
Join Date: Aug 2007
Posts: 259
Thanks: 1
Thanked 1 Time in 1 Post
airforceruss is on a distinguished road
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.

airforceruss is offline   Reply With Quote
Old 11-01-2007, 10:47 AM   #4
airforceruss
Newly Registered User
 
Join Date: Aug 2007
Posts: 259
Thanks: 1
Thanked 1 Time in 1 Post
airforceruss is on a distinguished road
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.
Attached Files
File Type: zip PPTDisplay.zip (353.3 KB, 140 views)
airforceruss is offline   Reply With Quote
Old 11-21-2007, 10:35 AM   #5
airforceruss
Newly Registered User
 
Join Date: Aug 2007
Posts: 259
Thanks: 1
Thanked 1 Time in 1 Post
airforceruss is on a distinguished road
Bumping this back up. Still looking for someone with some knowledge.
airforceruss is offline   Reply With Quote
Old 11-21-2007, 11:04 AM   #6
Rabbie
Super Moderator
 
Rabbie's Avatar
 
Join Date: Jul 2007
Location: Returning to Scotland
Posts: 5,906
Thanks: 110
Thanked 76 Times in 68 Posts
Rabbie is a jewel in the rough Rabbie is a jewel in the rough Rabbie is a jewel in the rough
I think we are all a bit unsure what your query is. please enlighten us
__________________
The best solution is the simplest one that meets all requirements.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Rabbie is offline   Reply With Quote
Old 11-21-2007, 11:24 AM   #7
airforceruss
Newly Registered User
 
Join Date: Aug 2007
Posts: 259
Thanks: 1
Thanked 1 Time in 1 Post
airforceruss is on a distinguished road
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.


airforceruss is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Automation Export to Powerpoint with Snapshot therandom Modules & VBA 0 06-28-2007 12:42 AM
Graph slideshow bobfin General 5 10-16-2005 08:45 AM
Any Ideas on Exporting Reports to PowerPoint? photoguy53 Reports 10 06-29-2005 07:08 AM
Hperlink to Powerpoint damian Modules & VBA 4 10-01-2004 04:50 AM
Linking Form Data to PowerPoint jenvandiver Forms 0 05-13-2003 10:37 AM




All times are GMT -8. The time now is 09:51 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World