图中的Shapes(1).GroupItems.Count=4,序号如图。
用下面的方法读取2、3、4的文本都没问题:
Debug.Print ActivePresentation.Slides(1).Shapes(1).GroupItems(2).TextFrame.TextRange.Text
Debug.Print ActivePresentation.Slides(1).Shapes(1).GroupItems(3).TextFrame.TextRange.Text
Debug.Print ActivePresentation.Slides(1).Shapes(1).GroupItems(4).TextFrame.TextRange.Text
但是GroupItems(1)中分了两段,所以读取1中的文本出错,提示“只能为单独的形状访问此成员”
Debug.Print ActivePresentation.Slides(1).Shapes(1).GroupItems(1).TextFrame.TextRange.Text
然后我用下面的代码又报错“只能为组合访问此成员”
ActivePresentation.Slides(1).Shapes(1).GroupItems(1).GroupItems.Count
也就是说Shapes(1).GroupItems(1)既不是单独的形状,又不是组合,那应该怎样取到1中的文本呢?或者用其它方法一次性取到整个幻灯片的文本也行,谢谢!

vba读取powerpoint中的smartart里的文本
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-