B
BigAnthony
Hi,
I am using the code below to transfer data from an Access 2003 table to be
displayed in PowerPoint.
Currently, it displays a footer, along with the date and slide number. How
do I go about adjusting the font size and colour of the text in the footer?
(Sorry about the line breaks)
Thanks,
Anthony
My Code here:
***********
Dim PPApp As Object 'late binding
Dim PPPres As Object
Dim PPSlide As Object
Dim db As Database, rs As Recordset
Dim strSql As String
Set PPApp = GetObject(, "PowerPoint.Application")
If PPApp Is Nothing Then 'no existing application is running
Set PPApp = CreateObject("PowerPoint.Application")
End If
If PPApp Is Nothing Then 'not able to create the application
MsgBox "The application is not available!",
vbExclamation+vbOKOnly,"Help."
End If
'Open up a recordset on the employee table.
Set db = CurrentDb
strSql = "SELECT * From [Employee] WHERE (Status = True);"
Set rs = db.OpenRecordset(strSql)
Set PPPres = PPApp.Presentations.Add
With PPApp
While Not rs.EOF
With PPPres.Slides
Set PPSlide = .Add(rs.AbsolutePosition + 1, 2)
PPSlide.HeadersFooters.Footer.Visible = True
PPSlide.HeadersFooters.Footer.Text = "My Footer Text Here."
PPSlide.HeadersFooters.DateAndTime.Visible = True
PPSlide.HeadersFooters.DateAndTime.UseFormat = True
PPSlide.HeadersFooters.DateAndTime.Format = 1
PPSlide.HeadersFooters.SlideNumber.Visible = True
PPSlide.Shapes(1).TextFrame.TextRange.Text =
UCase(CStr(rs.Fields("EmployeeID").value))
PPSlide.Shapes(2).TextFrame.TextRange.Text = "Name =
" & CStr(rs.Fields("FirstName").value) & vbCrLf & _
"Surname = " & CStr(rs.Fields("Surname").value)& vbCrLf & _
"Phone = " & CStr(rs.Fields("Phone").value) & vbCrLf & _
"Level = " & CStr(rs.Fields("Level").value)
PPSlide.Shapes(1).TextFrame.TextRange.Characters.Font.Size = 30
PPSlide.Shapes(2).TextFrame.TextRange.Characters.Font.Size = 26
PPSlide.Shapes(2).TextFrame.TextRange.Characters.Font.Color =
vbBlue
End With
rs.MoveNext
Wend
End With
PPPres.SlideShowSettings.Run
Set PPApp = Nothing
Set PPSlide = Nothing
Set PPPres = Nothing
End If
End If
I am using the code below to transfer data from an Access 2003 table to be
displayed in PowerPoint.
Currently, it displays a footer, along with the date and slide number. How
do I go about adjusting the font size and colour of the text in the footer?
(Sorry about the line breaks)
Thanks,
Anthony
My Code here:
***********
Dim PPApp As Object 'late binding
Dim PPPres As Object
Dim PPSlide As Object
Dim db As Database, rs As Recordset
Dim strSql As String
Set PPApp = GetObject(, "PowerPoint.Application")
If PPApp Is Nothing Then 'no existing application is running
Set PPApp = CreateObject("PowerPoint.Application")
End If
If PPApp Is Nothing Then 'not able to create the application
MsgBox "The application is not available!",
vbExclamation+vbOKOnly,"Help."
End If
'Open up a recordset on the employee table.
Set db = CurrentDb
strSql = "SELECT * From [Employee] WHERE (Status = True);"
Set rs = db.OpenRecordset(strSql)
Set PPPres = PPApp.Presentations.Add
With PPApp
While Not rs.EOF
With PPPres.Slides
Set PPSlide = .Add(rs.AbsolutePosition + 1, 2)
PPSlide.HeadersFooters.Footer.Visible = True
PPSlide.HeadersFooters.Footer.Text = "My Footer Text Here."
PPSlide.HeadersFooters.DateAndTime.Visible = True
PPSlide.HeadersFooters.DateAndTime.UseFormat = True
PPSlide.HeadersFooters.DateAndTime.Format = 1
PPSlide.HeadersFooters.SlideNumber.Visible = True
PPSlide.Shapes(1).TextFrame.TextRange.Text =
UCase(CStr(rs.Fields("EmployeeID").value))
PPSlide.Shapes(2).TextFrame.TextRange.Text = "Name =
" & CStr(rs.Fields("FirstName").value) & vbCrLf & _
"Surname = " & CStr(rs.Fields("Surname").value)& vbCrLf & _
"Phone = " & CStr(rs.Fields("Phone").value) & vbCrLf & _
"Level = " & CStr(rs.Fields("Level").value)
PPSlide.Shapes(1).TextFrame.TextRange.Characters.Font.Size = 30
PPSlide.Shapes(2).TextFrame.TextRange.Characters.Font.Size = 26
PPSlide.Shapes(2).TextFrame.TextRange.Characters.Font.Color =
vbBlue
End With
rs.MoveNext
Wend
End With
PPPres.SlideShowSettings.Run
Set PPApp = Nothing
Set PPSlide = Nothing
Set PPPres = Nothing
End If
End If