ilios86
ilios86

Reputation: 23

How can I copy and paste slides as a picture in PowerPoint using VBA?

I want to cut one slide and paste it as a picture in same presentation file (ppt format).

I know that following VBA code work for copy&paste in a single slide.

ActivePresentation.Slides(1).Copy   ''copy first slide into clipboard
ActivePresentation.Slides.Paste     ''paste above slide as a last slide

What I want to know is how to paste a slide as a "picture". ('paste as a picture' is an option of Paste Special [e.g. paste as a PNG,JPEG...])

Are there any suggestions for how to go about this?

Upvotes: 2

Views: 14196

Answers (1)

Todd Main
Todd Main

Reputation: 29155

Yeah, your code was pretty close. Here's an example of taking Slide 1 and pasting it as a picture in Slide 2.

ActivePresentation.Slides(1).Copy
ActivePresentation.Slides(2).Shapes.PasteSpecial ppPasteJPG

You can look up PpPasteDataType for more formats to paste to.

Upvotes: 1

Related Questions