Save all Shapes of slide into single JPG image

不羁的心 提交于 2019-12-02 12:43:56

问题


I have a small tool to export the pictures inside ppt documents to image files, so I can import them somewhere else. For this, I have been using the following piece of code:

For Each slideShape In slide
    If slideShape.Type = msoPicture Then
        Call slideShape.Export(materialPresentation.Path & "\" & ecode & "_" & cont & ".jpg", ppSaveAsJPG)
        cont = cont + 1
    End If
Next slideShape

However, in a different tool, I am required to export all the shapes of a slide at once, exactly like selecting them with the mouse, and clicking in "Save as image", which creates an image with all the shapes.

Is there a way to do it using VBA? All I found online were examples of exporting single shapes (Which I already know).


回答1:


Group the shapes you want to export then export the resulting group shape.




回答2:


What may also work is exporting via ShapeRange (slide is a Slide object), e.g.

slide.Shapes.Range().Export("C:\output.jpg", ppShapeFormatJPG)


来源:https://stackoverflow.com/questions/25427404/save-all-shapes-of-slide-into-single-jpg-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!