tonydeleon
tonydeleon

Reputation: 151

Powerpoint Visual Basic Save as Picture

I'm trying to save as picture the active slide I'm working on using VB in Powerpoint. This code works fine, but only with the slide number (1) and if all images and shapes are selected, how could I do to select all the objects on the active slide (like CTRL + A) and then export it as an picture?

Sub Export_Image()

ActivePresentation.Slides(1).Select
Call ActiveWindow.Selection.ShapeRange(1).Export( _
"C:\ARTES\CRETA.png", ppShapeFormatPNG, 1500, 1500, ppRelativeToSlide)


End Sub

Upvotes: 0

Views: 325

Answers (1)

BigBen
BigBen

Reputation: 49998

You're looking for Slide.Export.

Sub ExportImage()
    ActiveWindow.View.Slide.Export FileName:="C:\ARTES\CRETA.png", _
                                   FilterName:="PNG", _
                                   ScaleWidth:=1500, _
                                   ScaleHeight:=1500
End Sub

Upvotes: 2

Related Questions