简体   繁体   English

使用代码/脚本/定义在 PowerPoint 中创建自定义形状或连接器

[英]Create custom shape or connector in PowerPoint using code/script/definition

The shapes in in PowerPoint 2007 seem to be built in - is there a way to create 'user'/'custom' shapes? PowerPoint 2007 中的形状似乎是内置的 - 有没有办法创建“用户”/“自定义”形状?

I wanted to create a custom connector, but knowing if you can create a custom shape, could be handy in the future.我想创建一个自定义连接器,但知道您是否可以创建自定义形状,将来可能会很方便。

There are several ways to do this, but not sure if they would meet your needs.有几种方法可以做到这一点,但不确定它们是否能满足您的需求。 If you need to have a custom shape added to the "insert shapes" drop-down and then place and size with your mouse cursor, then I know of no way to do this.如果您需要将自定义形状添加到“插入形状”下拉菜单中,然后使用鼠标 cursor 进行放置和调整大小,那么我不知道该怎么做。

However, if you would like to define a custom shape and then programmatically add this to a location in your presentation, this is doable for sure.但是,如果您想定义一个自定义形状,然后以编程方式将其添加到演示文稿中的某个位置,这肯定是可行的。 In VBA and VSTO, this is can be done via the Object Model;在 VBA 和 VSTO 中,这可以通过 Object Model 来完成; you can add a FreeForm shape, polylines, curves, etc. and in some cases group these to form a single shape.您可以添加 FreeForm 形状、多段线、曲线等,并且在某些情况下将它们组合成一个形状。 I've done as much with a series of 9-pointed stars that I needed on a regular basis.我已经完成了一系列我经常需要的 9 角星。

To create a custom shape/connector in Drawing ML also appears possible.在 Drawing ML 中创建自定义形状/连接器也是可能的。 It is not something I've tried yet, but it certainly looks as if it can be done.这不是我尝试过的事情,但看起来确实可以做到。 There are a number of calculations you would need for this that are well documented in the Ecma specs.为此,您需要进行许多计算,这些计算在 Ecma 规范中有详细记录。 By "well documented", I don't mean "easy" though - all of the formulas can be complex.我所说的“有据可查”并不是指“容易”——所有的公式都可能很复杂。 In the case of the connector, it looks as if you would need to programmatically change the shapes your connector is connecting to though to your custom connector (shapes identify their connector, if they have one).在连接器的情况下,您似乎需要以编程方式将连接器连接到的形状更改为自定义连接器(形状标识其连接器,如果有的话)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM