Powerpoint编辑如何将一种形状从一张幻灯片复制到另一张幻灯片 [英] Powerpoint editing how to copy one shape from one slide to another

查看:189
本文介绍了Powerpoint编辑如何将一种形状从一张幻灯片复制到另一张幻灯片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是c#编程的新手,但是整个ms office库都让我感到困惑。我想从一张幻灯片3复制一个文本框,然后将其粘贴到幻灯片2中。我按照我发现的页面上的说明进行操作:如何在c#中将形状从一张幻灯片复制到另一张幻灯片?

I'm a newbie in c# programming and I'm just confounded by the entire ms office library. I want to copy a textbox from one slide 3 and paste it in slide 2. I followed instruction from a page I found: How can I copy shapes from one slide to another slide in c#?

presentation.Slides[3 + 1].Shapes[2 + 1].Copy();
presentaiton.Slides.Paste(2 + 1);

但是出现错误信息并说:由于剪贴板为空或包含与幻灯片不兼容的东西而无法粘贴。我看不到剪贴板是空的。实际上,我可以将其粘贴在单词上,然后查看其含义-一次是一张空白图片,另一张是幻灯片中的灰色阴影。所以总的来说,我有两个问题:如何知道应该复制哪种阴影以及为什么c#不允许复制形状并将其粘贴到另一个阴影中?

But error message emerges and says: cannot paste because the clipboard is empty or contains things incompatible with the slide. I don't see the clipboard is empty. In fact I can paste it on the word and see what it was - One time it was a blank picture and another a gray shade which are in that slide. So in general I have two problem: how to know which shade I should copy out and why doesn't c# allow copying a shape and paste it in another?

我想知道是否有完整的或官方的库或教程可以在c#上使用powerpoint进行操作,而不是ms网站上完全没有用的。

Also I'm wondering if there is a complete or official library or tutorial for operating on powerpoint in c# other than that on ms website which is completely useless.

推荐答案

在vba中,您可以这样做:

In vba it, you'd do it like this:

ActivePresentation.Slides(2).Shapes(3).Copy
ActivePresentation.Slides(3).Shapes.Paste

复制幻灯片2上的第三个形状到幻灯片3

This'd copy the third shape on slide 2 to slide 3

这篇关于Powerpoint编辑如何将一种形状从一张幻灯片复制到另一张幻灯片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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