How do I copy a Shape from one Powerpoint presentation to another in VBA?

倖福魔咒の 提交于 2019-12-24 01:39:15

问题


I have VBA code to copy shapes matching a certain criteria from one Powerpoint presentation to another below. However, when it pastes the shape, it is offset (down and to the right) from the original position. How can I copy a shape while maintaining the original coordinates?

sourceShape.Copy
Presentations(2).Windows(1).Activate
ActivePresentation.Slides(x).Shapes.Paste (1)

回答1:


Perhaps simply:

Shape s=ActivePresentation.Slides(x).Shapes.Paste (1)

s.Left=sourceShape.Left

s.Top=sourceShape.Top


来源:https://stackoverflow.com/questions/5073988/how-do-i-copy-a-shape-from-one-powerpoint-presentation-to-another-in-vba

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