·  Start ·  Programme ·  Codes ·  Tipps ·  ActiveX ·  Tutorials · 



Wandelt eine Powerpoint-Präsentation (ppt) in einzelne Bilder des Typs *.png um. Sie benötigen 1 Form, zwei Textboxen (Text1 und Text2), sowie einen Commandbutton.

Private Sub Command1_Click()
 
Dim pptAppl As PowerPoint.Application
Dim pptPres As PowerPoint.Presentation
Dim pptWarOffen As Boolean
Dim path As String
Dim DestPath As String
PathPPT = Text1.Text    'Pfad zur PPT-Datei
DestPath = Text2.Text   'Zielordner zB C:\test
 
On Error Resume Next
 
    Set pptAppl = GetObject(, "PowerPoint.Application")
    On Error GoTo errorMsgPPT
 
    If pptAppl Is Nothing Then
        Set pptAppl = CreateObject("PowerPoint.Application")
    Else
        pptWarOffen = True
    End If
 
    Me.MousePointer = vbHourglass
 
     'Presentation unsichtbar öffnen
    Set pptPres = pptAppl.Presentations.Open(FileName:=PathPPT, withwindow:=msoFalse)
 
    pptPres.Export DestPath, "png", 800, 600
    pptPres.Close
    If pptWarOffen = False Then
        pptAppl.Quit
    End If
 
    Set pptPres = Nothing
    Set pptAppl = Nothing
 
Me.MousePointer = vbDefault
Exit Sub
 
errorMsgPPT:
  Resume
  Me.MousePointer = vbDefault
  MsgBox "Error: " & _
  Err.Description & vbCrLf & _
  Err.Number
 
  Set pptPres = Nothing
  Set pptAppl = Nothing
 
End Sub

Private Sub Form_Load()
' Unbedingt Verweis auf "Microsoft PowerPoint 10.0 Object Library"
' setzen ! "10.0" steht für Office XP, auch andere Varianten sind
' möglich.
 
    Text1.Text = "C:\test\sample.ppt"
    Text2.Text = "C:\output"
    Command1.Caption = "Convert !"
End Sub
Aktualisiert: 12.02.2008, 14:10 Uhr Copyright © 2001 - 2010 by ST-software Navigation zurück  |  Navigation vorwärts  |  Zum Seitenanfang     
Ihre IP: 38.107.191.84 ·  Seite erstellt in: 0.176 Sekunden ·  Dateigröße:  3535 Bytes