开发者

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

开发者 https://www.devze.com 2023-02-05 07:18 出处:网络
开发者_运维问答I want to cut one slide and paste it as a picture in same presentation file (ppt format).

开发者_运维问答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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消