Control PowerPoint from Access

R

RAM

I have been able to create a PowerPoint presentation using the following
code. The code below shows how to create a presentation using one field
(text field) but I would like to include Images in the presentation. If
anyone can explain to me how to use multiple fields and insert images that I
have stored in my database I would be most appreciative.


Thanks in advance for any help.

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("VideoTable", 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
.SlideShowTransition.EntryEffect = ppEffectFade
With .Shapes(2).TextFrame.TextRange
.Text = CStr(rs.Fields("QUES").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

' Run the show.
ppPres.SlideShowSettings.Run

Exit Sub

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

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