我正在制作一个演示文稿,其中包含大约 150 个需要跟踪的组合表格和图表。选择和可见性窗格(图片工具 > 排列 > 选择窗格)允许我命名和查看幻灯片上的所有形状的列表,但是是否有选项可以上一级并查看整个演示文稿中使用的所有形状的列表?
答案1
不,PowerPoint 没有任何允许您执行此操作的功能。
你到底想做什么?也许还有其他方法。
答案2
我想根据在以下堆栈溢出线程中发现的 VBA,对上述我自己的问题提供部分答案:VBA 列出 PowerPoint 演示文稿的所有对象名称
从技术上讲,该解决方案允许人们通过文本文件报告查看 Power Point 演示文稿中使用的所有形状。
Sub ListAllShapes()
Dim curSlide As Slide
Dim curShape As Shape
Dim lFile As Long
Dim sPath As String
sPath = ActivePresentation.Path
lFile = FreeFile
Open sPath & "\All Shapes.txt" For Append As #lFile
For Each curSlide In ActivePresentation.Slides
Print #lFile, "SLIDE " & curSlide.SlideNumber
For Each curShape In curSlide.Shapes
Print #lFile, " " & curShape.Name
Next curShape
Next curSlide
Close #lFile
End Sub
这将生成如下所示的文本报告:
SLIDE 1
Rectangle 2
Rectangle 4
Rectangle 4
TextBox 10
Rectangle 4
SLIDE 2
TextBox 7
Rectangle 2
Rectangle 4
Rectangle 4
Line 37
Picture 1
Picture 2
SLIDE 3
Rectangle 2
Rectangle 4
Rectangle 7
TextBox 7
Line 28
Picture 3
Picture 4, etc...
对于我的特定用例,我想要每个幻灯片仅包含某些形状的列表,我首先使用选择窗格为包含带有适当前缀的图形或表格的每张图片命名,然后运行以下命令来实现:
Sub ListFiguresAndTables()
Dim curSlide As Slide
Dim curShape As Shape
Dim lFile As Long
Dim sPath As String
sPath = ActivePresentation.Path
lFile = FreeFile
Open sPath & "\Figures and Tables.txt" For Append As #lFile
For Each curSlide In ActivePresentation.Slides
Print #lFile, "SLIDE " & curSlide.SlideNumber
For Each curShape In curSlide.Shapes
If Left(curShape.Name, 4) = "Fig." Or Left(curShape.Name, 5) = "Table" Then
Print #lFile, " " & curShape.Name
End If
Next curShape
Next curSlide
Close #lFile
End Sub
不幸的是,我让宏按升序打印这些对象的唯一方法是先使用选择窗格手动按相反(降序)顺序排列形状。
SLIDE 1
Fig. 1
Fig. 2
Fig. 3
Table 1
SLIDE 2
Fig. 4
Fig. 5
Fig. 6
SLIDE 3
Table 2
Table 3 (etc.)