如何将Shape从一个Powerpoint演示文稿复制到VBA中的另一个演示文稿? [英] How do I copy a Shape from one Powerpoint presentation to another in VBA?

查看:112
本文介绍了如何将Shape从一个Powerpoint演示文稿复制到VBA中的另一个演示文稿?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有VBA代码,可以将符合特定条件的形状从一个Powerpoint演示文稿复制到下面的另一个演示文稿。但是,粘贴形状时,它会偏离原始位置(向下和向右)。如何在保持原始坐标的同时复制形状?

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)


推荐答案

也许简单:

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

s.Left=sourceShape.Left

s.Top=sourceShape.Top

这篇关于如何将Shape从一个Powerpoint演示文稿复制到VBA中的另一个演示文稿?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆