Exporting data from Access to Powerpoint

D

dlmcfc

Hi,

I have an Access databse with about 150 records in it. I would like to
export selected fields from the database to a Powerpoint presentation.

Each record in the database represents a project, and each project requires
an individual slide.

Each slide would be identical in terms of formatting, but the data in each
text box on the slide would need to be imported from a different field the
Access databse.

I have found some example code on the Internet that has allowed me to export
the data from Access to Powerpoint. I created a 'Form' in Access and assigned
some VB code to a command button. When the button is clicked, a Powerpoint
presentation is created, and the title of each project is placed on an
individual slide, along with the project owners name. Here is the code:

----------------------------------------------------------------

Option Compare Database

Option Explicit

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 Project List table.
Set db = CurrentDb
Set rs = db.OpenRecordset("Project List", dbOpenDynaset)

' Open up 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 =
CStr(rs.Fields("Topic_Owner (my:myFields/my:CBT_Topic_Owner)").Value)
.Shapes(2).TextFrame.TextRange.Text =
CStr(rs.Fields("Project_Name").Value)
End With
rs.MoveNext
Wend
End With

Exit Sub

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

-----------------------------------------------------------------------------

My question is, can I add more fields to be exported? Currently there is
only two fields, and I need about 20 per slide.

Also, can I format the slide, so text boxes are aligned, coloured and sized
to my requirements? Could I specify a pre-formatted slide that should be used
when creating the presentation?

I have tried to do this myself, but my lack of coding knowledge is
restricting me!

Many thanks in advance,
dlmcfc
 
L

Lucy Thomson

Hi there

I have no coding knowledge at all so I'm afraid I can't help you with that,
but you may want to look at PPT Merge:
http://www.pptools.com/merge/index.html I don't think it will pull data
directly from the access db but if you send it to excel or a csv first it
should work. I believe the demo is fully functional so you can see if it
will meet your needs.

Lucy
 
D

dlmcfc

Thanks for the tip Lucy!

Lucy Thomson said:
Hi there

I have no coding knowledge at all so I'm afraid I can't help you with that,
but you may want to look at PPT Merge:
http://www.pptools.com/merge/index.html I don't think it will pull data
directly from the access db but if you send it to excel or a csv first it
should work. I believe the demo is fully functional so you can see if it
will meet your needs.

Lucy

--
Lucy Thomson
PowerPoint MVP
MOS Master Instructor
www.aneasiertomorrow.com.au
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top