Using VBA to change Picture

后端 未结 10 1028
庸人自扰
庸人自扰 2020-12-10 12:41

I am trying to use VBA to automate the Change Picture function when you right click a Shape in Excel/Word/Powerpoint.

However, I am not able to find any reference, c

10条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 12:56

    You can change the source of a picture using the UserPicture method as applied to a rectangle shape. However, you will need to resize the rectangle accordingly if you wish to maintain the picture's original aspect ratio, as the picture will take the dimensions of the rectangle.

    As an example:

     ActivePresentation.Slides(2).Shapes(shapeId).Fill.UserPicture ("C:\image.png")
    

提交回复
热议问题