Sub cmdPowerPoint_Click()
Dim db As Database, rs As Recordset, fd As Field2
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("SELECT * FROM Umpires WHERE ID = 1", 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 = rs("LastN")
.Characters.Font.Color.RGB = RGB(255, 0, 255)
.Characters.Font.Shadow = True
End With
With .Shapes.AddShape(msoShapeOval, 360, 121, 220, 220) 'photo
'Set fd = rs("Test1")
'fd("FileData").SaveToFile CurrentProject.Path
'.Fill.UserPicture CurrentProject.Path & "\" & fd("FileName")
'.line.Visible = False 'no outline
'Kill CurrentProject.Path & "\" & fd("FileName")
End With
With .Shapes.AddShape(msoShapeOval, 85, 260, 85, 85) 'customer
.Fill.ForeColor.RGB = RGB(239, 48, 120)
.line.Visible = False
End With
With .Shapes.AddShape(msoShapeOval, 85, 355, 135, 135) 'improvement (down)
.Fill.ForeColor.RGB = RGB(0, 176, 240)
.line.Visible = False
End With
With .Shapes.AddShape(msoShapeOval, 38, 136, 110, 110) 'staff
.Fill.ForeColor.RGB = RGB(238, 149, 36)
.line.Visible = False
End With
With .Shapes.AddShape(msoShapeOval, 158, 45, 135, 135) 'improvement (up)
.Fill.ForeColor.RGB = RGB(0, 176, 240)
.line.Visible = False
End With
With .Shapes.AddShape(msoShapeOval, 193, 206, 135, 135) 'characteristics
.Fill.ForeColor.RGB = RGB(238, 149, 36)
.line.Visible = False
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
End Sub