0

I have a VBA script which needs to save embedded images from the selected powerpoint as .png files onto disk. I am able to save an entire slide, but that's not practical

I have found a couple of VBA solutions which require creation of an embedded Excel chart (eg this answer), using clipboard to copy and paste the image there and then save the chart but it seems clumsy and I would prefer not to impact the users clipboard (though if that's what it's going to take, then I'll have to take that approach)

braX
  • 11,506
  • 5
  • 20
  • 33
Offbeatmammal
  • 7,970
  • 2
  • 33
  • 52

1 Answers1

2

One approach is to create a new presentation whose slide size is proportional to the size of the image you want to export, copy/paste the image to the new presentation, then export the slide from it.

You might also want to experiment with the (hidden) .Export method of the shape that represents the image you want to export. Getting the sizing right can be something of a challenge, but I think someone's worked it out and posted on SO.

Steve Rindsberg
  • 14,442
  • 1
  • 29
  • 34
  • using `Call {object}.Export(filename, ppShapeFormatPNG) seems to work (wonder why it's hidden?!) and as I'm explicitly setting the size where it's used it's usable. – Offbeatmammal May 05 '20 at 07:20