Hej! Hittade koden nyss på nätet när jag letade lite...PowerPoint-makro för att spara alla slides i PNG-format
Undrar hur jag skriver ett Visual Basic -makro för PowerPoint som automatiskt sparar alla slides som PNG filer med en viss förutbestämd storlek (höjd+bredd)? Har testat men inte fått till det så jag vore tacksam för några kod-exempel på detta.
Tack på förhand!
/DanielSv: PowerPoint-makro för att spara alla slides i PNG-format
Tänkte att jag kan ju lägga in den här ifall nån annan skulle ha nytta av detta... /Daniel
Sub savegraphic()
' Set desired_slide equal to the slide number to be exported.
Const desired_slide As Long = 1
' Set path equal to the desired file storage location.
Const path As String = "c:"
' Set filename equal to the desired name of the graphic file.
Const filename As String = "slide" & desired_slide
' Set graphic_type equal to three letter
' extension for your graphic type.
Const graphic_type As String = "png"
' Set scalewidth equal to horizontal
' width in pixels where 96 pixels = 1 inch.
' This parameter applies to PNG, GIF & JPG, but not WMF
Const scalewidth As Long = 240
' Set scaleheight equal to vertical
' height in pixels where 96 pixels = 1 inch.
' This parameter applies to PNG, GIF & JPG, but not WMF
Const scaleheight As Long = 192
' Exports the desired slide as a graphic.
With Application.ActivePresentation.Slides(desired_slide)
.Export path & "\" & filename, graphic_type, scalewidth, _
scaleheight
End With
MsgBox "you have successfully exported slide" & desired_slide _
& " to" & Chr(13) & path & "\" & filename & "." _
& graphic_type, _
vbInformation, "Export Result"
End Sub