Onderstaande macro converteert PPT naar JPG. Echter alle JPG's komen in dezelfde output-map.
Hoe macro aan te passen zodat de JPG's (met de bestandsnaam van de PPT) worden weggeschreven in een eigen map met de naam van betreffende PPT?
Hoe macro aan te passen zodat de JPG's (met de bestandsnaam van de PPT) worden weggeschreven in een eigen map met de naam van betreffende PPT?
Code:
Option Explicit
Public Sub PresentationsToImages()
Dim lngPresentations As Long
Dim strImageName As String
Dim strImagePath As String
Dim strPresentationName As String
Dim strPresentationPath As String
Dim objSlide As Object
On Error Resume Next
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = True
.Show
For lngPresentations = 1 To .SelectedItems.Count
strPresentationPath = .SelectedItems(lngPresentations)
Presentations.Open strPresentationPath, msoTrue
With ActivePresentation
strPresentationName = Split(.Name, ".")(0)
strImagePath = .path
For Each objSlide In .Slides
With objSlide
strImageName = strPresentationName & "-" & Format(.SlideIndex, "000") & ".jpg"
.Export strImagePath & "\" & strImageName, "JPG"
End With
Next
.Close
End With
Next
End With
MsgBox "Presentations exported as images."
End Sub