Option Compare Database
Option Explicit
Sub cmdPowerPoint_Click()
Dim db As Database, rs As Recordset 'new vars db = Database & rs = Recordset
Dim ppObj As PowerPoint.Application 'new var ppobj = PP.Application
Dim ppPres As PowerPoint.Presentation 'new var ppPres = PP.Presentation
On Error GoTo err_cmdOLEPowerPoint 'Errorhandling
' Open up a recordset on the Employees table.
Set db = CurrentDb 'Current DB is set as source
Set rs = db.OpenRecordset("User", dbOpenDynaset) 'Open DB Table with OpenRecordset and add the Table
' Open up an instance of Powerpoint.
Set ppObj = New PowerPoint.Application 'inize ppObj
Set ppPres = ppObj.Presentations.Add 'inize ppPres with ppObj.Presentations
' Setup the set of slides and populate them with data from the
' set of records.
With ppPres ' PPres is fed with data from rs
While Not rs.EOF ' Going through whole rs
With .Slides.Add(rs.AbsolutePosition + 1, ppLayoutTitle) 'adding all slides and text
.Shapes(1).TextFrame.TextRange.Text = "Hi! Page " & rs.AbsolutePosition + 1 'set title text on slides
.SlideShowTransition.EntryEffect = ppEffectFade 'set effect when changing page
With .Shapes(2).TextFrame.TextRange 'adding text
.Text = CStr(rs.Fields("Lastname").Value) 'get text from table
.Characters.Font.Color.RGB = RGB(255, 0, 255) 'set color of text
.Characters.Font.Shadow = True 'set text properties
End With
.Shapes(1).TextFrame.TextRange.Characters.Font.Size = 50 'set font size
End With
rs.MoveNext 'Move to next record
Wend
End With
' Run the show.
ppPres.SlideShowSettings.Run
Exit Sub
err_cmdOLEPowerPoint: 'Errorhandling
MsgBox Err.Number & " " & Err.Description
End Sub
Zuerst PowerPoint 2007 zu Flash Konverter
W.Peterson 11.07.2007 - 102 Hits -
Titel im Pivotchart per VBA ändern/aktualisieren
Booyeoo 28.07.2007 - 36 Hits -
acces point gefunden doch seiten laden nicht
schnuppe 02.08.2007 - 61 Hits - 3 Antworten
PivotChart- Bericht
wim 25.08.2007 - 19 Hits - 6 Antworten