开发者

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

开发者 https://www.devze.com 2023-02-12 06:20 出处:网络
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

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)


Perhaps simply:

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

s.Left=sourceShape.Left

s.Top=sourceShape.Top
0

精彩评论

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