【问题描述】VBA如何获取PPT母版和版式的列表呢?
【小千解答】Designs是设计模板/母版/设计方案的集合,CustomLayouts是版式的集合。
代码如下:
Sub xqoffice() Dim i As Byte Dim j As Byte With ActivePresentation For i = 1 To .Designs.Count Debug.Print "母版/设计方案" & i & "名称:" & .Designs(i).Name With .Designs(i).SlideMaster Debug.Print "版式数量:" & .CustomLayouts.Count For j = 1 To .CustomLayouts.Count Debug.Print "版式" & j & "名称:" & .CustomLayouts(j).Name Next j End With Next i End With End Sub
运行结果:
【参考资料】