【问题标题】:VBA powerpoint. set a shape as a variableVBA 简报。将形状设置为变量
【发布时间】:2018-05-02 23:09:50
【问题描述】:

我有一个很简单的问题,我搜索了如何选择powerpoint shape,找到的代码如下。

Presentation.Slide(1).Shape(1)

但是当我这样做时

Dim a As Shape
Set a=Presentation.Slide(1).Shape(1)

我得到一个类型不匹配。 Presentation.slide().shape() 命令返回什么对象类? MSDN 网站说它是一个形状对象(“只读”,我不知道这是什么意思) https://msdn.microsoft.com/en-us/vba/powerpoint-vba/articles/slide-shapes-property-powerpoint

那么为什么上面的代码会出现不匹配错误。

另外,我怎么知道一行代码会返回哪类对象。例如,我想在控制台中编写这样的内容,以获取它生成的对象的类

Class(Presentantion.Slide(1).Shape(1))

(如果有控制台)

【问题讨论】:

    标签: vba object shape


    【解决方案1】:

    您发布的代码中有一些拼写错误

    typename(activepresentation.slides(1).shapes(1))
    

    我想的都会给你你想要的。

    【讨论】:

      猜你喜欢
      • 2019-06-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-18
      • 2017-08-17
      • 2018-01-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多