VBA Code to Convert Ppwerpoint Slide to Image (JPEG)
Here is a simple code that will Export all slides in a powerpoint presentation to Jpeg files
Sub Save_PowerPoint_Slide_as_Images()
Dim sImagePath As String
Dim sImageName As String
Dim oSlide As Slide '* Slide Object
Dim lScaleWidth As Long '* Scale Width
Dim lScaleHeight As Long '* Scale Height
On Error GoTo Err_ImageSave
sImagePath = "C:\ForBlogger\"
For Each oSlide In ActivePresentation.Slides
sImageName = oSlide.Name & ".jpg"
oSlide.Export sImagePath & sImageName, "JPG"
Next oSlide
Err_ImageSave:
If Err <> 0 Then
MsgBox Err.Description
End If
End Sub
Wednesday, May 20, 2009
Download Windows Live Toolbar and personalize your Web experience! Add custom buttons to get the information you care about most.
PowerPoint comes with the ability to do this. Just do Save As, and for "Save as type:" choose JPG.
ReplyDeleteIs there a way to know the names of Image files that will be stored as JPEGs/PNGs using Powerpoint Export option
ReplyDeleteNice! Is there a way to add a count down timer to a PowerPoint Presentation lets say 25min when a button is pressed. I want to use this on my presentation to time my students when answering questions. Thank you!
ReplyDeleteWell that's nice, but can I save a slide as a picture and add a date in the file name ?
ReplyDeleteIs there a way to get this to save and name based off of a piece of text in the slide?
ReplyDeleteYou can change it in the following lines of code:
DeletesImageName = oSlide.Name & ".jpg"
oSlide.Export sImagePath & sImageName, "JPG"
Instead of oSlide.Name you can either enter a predetermined name using quotations i.e "text"
For what you want though you will need to set a variable i.e
Dim txt_text As String
Set txt_text = ActivePresentation.Slides(1).Shapes("SlideText")
The only issue you may have with this way of doing things is if the text box you are calling has alot of text. If its just a title it will be fine.
Hope this helps
how to run this VBA.
ReplyDelete