使用VSTO在PowerPoint中对象前面的对象列表

发布于 2025-02-09 09:38:57 字数 424 浏览 2 评论 0原文

PowerPoint幻灯片中几乎没有形状对象。矩形,椭圆,平行四边形,三角形和五角大楼以该顺序绘制,这意味着矩形在所有对象的背面。

当通过PowerPoint中的对象迭代时,可以获取所有位于对象前方/后面的对象的列表,并部分或完全落在其内部中。 PowerPoint中可能有很多对象,并且将每个对象与每个对象进行比较是一个不利的解决方案。

我想将对象列表(在这种情况下 - 椭圆形,平行四角和三角形)与矩形有关。如何使用VSTO以编程方式实现这一目标?

There are few shape objects in a PowerPoint slide. The rectangle, ellipse, parallelogram, triangle and pentagon were drawn in that order meaning rectangle is at the back of all objects.

When iterating through the objects in PowerPoint, is it possible to get a list of all objects that lie in front/behind of an object and fall partially or fully within it. There may be a lot of objects in the PowerPoint and comparing each object against each object is a not a favorable solution.

I would like to get the list of objects(in this case - ellipse, parallelogram and triangle) against the rectangle. How can I achieve that programmatically using VSTO?

Source PowerPoint slide

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

︶ ̄淡然 2025-02-16 09:38:57

PowerPoint对象模型提供返回或设置指定形状对象的形状类型的属性,该对象必须代表autoShape以外的其他行,自由图绘图或连接器。因此,您可能会使用类似的东西:

If ActivePresentation.Slides(1).Shapes(1).Type = msoAutoShape Then
  If ActivePresentation.Slides(1).Shapes(1).AutoShapeType = msoShapeOval Then
    'Do something here
  End If
End If

The PowerPoint object model provides the Shape.AutoShapeType property which returns or sets the shape type for the specified Shape object, which must represent an AutoShape other than a line, freeform drawing, or connector. So, you may use something like that:

If ActivePresentation.Slides(1).Shapes(1).Type = msoAutoShape Then
  If ActivePresentation.Slides(1).Shapes(1).AutoShapeType = msoShapeOval Then
    'Do something here
  End If
End If
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文