B
biganthony via AccessMonster.com
Hi,
I found this code on Microsoft's website for transferring data from a table
to a PowerPoint file.
Out of curiosity, I was wondering how to get it to display four fields from a
record on each slide, instead of the one that it shows below. Currently, it
displays the EmployeeCode on separate slides. I would like to know how to get
it to show, EmployeeCode, EmployeeFirst, EmployeeSurname and EmployeePosition.
Dim db As Database, rs As Recordset
Dim ppObj As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
'Open up a recordset on the Employees table.
Set db = CurrentDb
Set rs = db.OpenRecordset("Employees", 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("EmployeeCode").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
Many thanks,
Anthony
I found this code on Microsoft's website for transferring data from a table
to a PowerPoint file.
Out of curiosity, I was wondering how to get it to display four fields from a
record on each slide, instead of the one that it shows below. Currently, it
displays the EmployeeCode on separate slides. I would like to know how to get
it to show, EmployeeCode, EmployeeFirst, EmployeeSurname and EmployeePosition.
Dim db As Database, rs As Recordset
Dim ppObj As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
'Open up a recordset on the Employees table.
Set db = CurrentDb
Set rs = db.OpenRecordset("Employees", 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("EmployeeCode").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
Many thanks,
Anthony