Search code examples
vbapowerpoint

VBA equivalent to Save As Picture in PPT


I am trying to use vba to save grouped shapes as an image in powerpoint. The "save as picture" function that you can use by right clicking on the group produces high quality images. My attempt to recreate the right-click function produces blurry, low quality images. Is there a way to exactly recreate the right click save as picture instead of export?

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

Solution

  • Add optional scaleheight/scalewidth parameters after the ppShapeFormat parameter. The results seem almost random, I don't know exactly what the parms are supposed to relate to, but the bigger the number you feed it, the higher the rez of the exported image.