Convert PowerPoint refrence to late binding in Access



Hi,

The following code below works with a Reference set to PowerPoint. Could
someone help me convert the folowing code to late binding? My attempt is
below the original code.

ORIGINAL CODE***************

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 employee
table.
With PPPres

While Not rs.EOF

With .Slides.Add(rs.AbsolutePosition + 1, ppLayoutText)

.Shapes(1).TextFrame.TextRange.Text = CStr(rs.Fields
("EmployeeCode").value)
.SlideShowTransition.EntryEffect = ppEffectBlank

With .Shapes(2).TextFrame.TextRange

.Text = "FTE = " & CStr(rs.Fields("EmployeeFirst").value)
& vbCrLf & _
"Allowance = " & TeachersAllowance & vbCrLf & _
"Teacher's Load = " & CStr(rs.Fields("EmployeeLast").
value) & vbCrLf & _
"Teaching Value = " & CStr(rs.Fields("EmployeeHours").
value) & vbCrLf & _
"Teaching Value = " & CStr(rs.Fields("EmployeePosition").
value) & vbCrLf & _
"Teaching Value = " & CStr(rs.Fields("EmployeeRate").
value)

.Characters.Font.Color.RGB = RGB(0, 0, 255)
.Characters.Font.Shadow = True
.Characters.Font.Size = 26

End With

.Shapes(1).TextFrame.TextRange.Characters.Font.Size = 30

End With

rs.MoveNext

Wend

End With

'run the show.
PPPres.SlideShowSettings.Run

********************************

This is my attempt. When I run it in the immediate window, I get an error
message saying "Object Required" (Error Number 424).


MY ATTEMPT ****************

Dim PPApp As Object
Dim PPPres As Object
Dim PPSlide As Object
Dim db As Database, rs As Recordset

'Open up a recordset on the Employees table.
Set db = CurrentDb
Set rs = db.OpenRecordset("Employees", dbOpenDynaset)

Set PPApp = CreateObject("Powerpoint.Application")
Set PPPres = PPApp.Presentations.Add

With PPPres

While Not rs.EOF

With pptPres.Slides

Set PPSlide = .Add(rs.AbsolutePosition + 1, ppLayoutText)

.Shapes(1).TextFrame.TextRange.Text = CStr(rs.Fields
("EmployeeCode").value)
.SlideShowTransition.EntryEffect = ppEffectBlank

With PPSlide

.Text = "FTE = " & CStr(rs.Fields("EmployeeFirst").value)
& vbCrLf & _
"Allowance = " & TeachersAllowance & vbCrLf & _
"Teacher's Load = " & CStr(rs.Fields("EmployeeLast").
value) & vbCrLf & _
"Teaching Value = " & CStr(rs.Fields("EmployeeHours").
value) & vbCrLf & _
"Teaching Value = " & CStr(rs.Fields("EmployeePosition").
value) & vbCrLf & _
"Teaching Value = " & CStr(rs.Fields("EmployeeRate").
value)

.Characters.Font.Color.RGB = RGB(0, 0, 255)
.Characters.Font.Shadow = True
.Characters.Font.Size = 26

End With

.Shapes(1).TextFrame.TextRange.Characters.Font.Size = 30

End With

rs.MoveNext

Wend

End With

'run the show.
PPPres.SlideShowSettings.Run

Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing


I would appreciate any help.

Thanks
Anthony

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200804/1

.



Relevant Pages

  • Re: Convert PowerPoint Reference to late Binding
    ... Dim db As Database, rs As Recordset ... 'Open up a recordset on the Employees table. ... value) & vbCrLf & _ ... Set PPPres = PPApp.Presentations.Add ...
    (microsoft.public.powerpoint)
  • Re: Convert PowerPoint Reference to late Binding
    ... Dim db As Database, rs As Recordset ... 'Open up a recordset on the Employees table. ... value) & vbCrLf & _ ... Set PPPres = PPApp.Presentations.Add ...
    (microsoft.public.powerpoint)
  • Convert PowerPoint Reference to late Binding
    ... Dim db As Database, rs As Recordset ... 'Open up a recordset on the Employees table. ... value) & vbCrLf & _ ... Set PPPres = PPApp.Presentations.Add ...
    (microsoft.public.powerpoint)
  • Re: Convert PowerPoint refrence to late binding in Access
    ... The following code below works with a Reference set to PowerPoint. ... Dim db As Database, rs As Recordset ... value) & vbCrLf & _ ... Set PPPres = PPApp.Presentations.Add ...
    (microsoft.public.access.modulesdaovba)
  • Re: Using ADODB.Recordset
    ... Dim DealID As Long, sSql As String ... Const adOpenForwardOnly As Long = 0 ... end) Project_Type, " & vbCrLf ... Basically, I am grabbing a one row recordset, and i would like to assign ...
    (microsoft.public.excel.programming)