请教PPT之VBA问题,急!!!
时间:2010-09-23
来源:互联网
Shapes.Placeholders(index)
其中index的值有多少,各对应什么类型?
作者: willson_62 发布时间: 2010-09-23
刚查了一下帮助,另根据一般VBA 的理解,是指幻灯片中所有占位符的集合的序列
INDEX为指定集合中对象的序列号
作者: yvhgydn 发布时间: 2010-09-23
作者: willson_62 发布时间: 2010-09-23
对象是Placeholder:幻灯片中的占位符
作者: yvhgydn 发布时间: 2010-09-23
作者: laose 发布时间: 2010-09-23
作者: willson_62 发布时间: 2010-09-23
ActivePresentation.Slides(1).Shapes.Placeholders.count
当前PPT中第一个幻灯片中所有占位符的数量(count),解释的也许有些不正确,因是刚刚查阅帮助,请高手指正
作者: yvhgydn 发布时间: 2010-09-23
呵呵,我就是希望得到文本、图表、表格、组织结构图等这些对象对应的索引值!!
作者: willson_62 发布时间: 2010-09-23
引用:
原帖由 willson_62 于 2010-9-23 13:28 发表laose:
呵呵,我就是希望得到文本、图表、表格、组织结构图等这些对象对应的索引值!!
作者: yvhgydn 发布时间: 2010-09-23
你如果方便,可在03和10的母板中分别用Debug.Print Shapes.Placeholders(2).Id 来看看其ID差别有多大。
作者: laose 发布时间: 2010-09-23
Sub Object_Types_on_This_Slide()
'Refers to each object on the current page and returns the Shapes.Type
'Can be very useful when searching through all objects on a page
Dim it As String
Dim i As Integer
Dim Ctr As Integer
'''''''''''''''''
'Read-only Long
'''''''''''''''''
For i = 1 To ActiveWindow.Selection.SlideRange.Shapes.Count
'No need to select the object in order to use it
With ActiveWindow.Selection.SlideRange.Shapes(i)
'But it is easier to watch when the object is selected
'This next line is for demonstration purposes only.
'It is not necessary
ActiveWindow.Selection.SlideRange.Shapes(i).Select
Select Case .Type
'Type 1
Case msoAutoShape
it = "an AutoShape. Type : " & .Type
'Type 2
Case msoCallout
it = "a Callout. Type : " & .Type
'Type 3
Case msoChart
it = "a Chart. Type : " & .Type
'Type 4
Case msoComment
it = "a Comment. Type : " & .Type
'Type 5
Case msoFreeform
it = "a Freeform. Type : " & .Type
'Type 6
Case msoGroup
it = "a Group. Type : " & .Type
' If it's a group them iterate thru
' the items and list them
it = it & vbCrLf & "Comprised of..."
For Ctr = 1 To .GroupItems.Count
it = it & vbCrLf & _
.GroupItems(Ctr).Name & _
". Type:" & .GroupItems(Ctr).Type
Next Ctr
'Type 7
Case msoEmbeddedOLEObject
it = "an Embedded OLE Object. Type : " & .Type
'Type 8
Case msoFormControl
it = "a Form Control. Type : " & .Type
'Type 9
Case msoLine
it = "a Line. Type : " & .Type
'Type 10
Case msoLinkedOLEObject
it = "a Linked OLE Object. Type : " & .Type
With .LinkFormat
it = it & vbCrLf & "My Source: " & _
.SourceFullName
End With
'Type 11
Case msoLinkedPicture
it = "a Linked Picture. Type : " & .Type
With .LinkFormat
it = it & vbCrLf & "My Source: " & _
.SourceFullName
End With
'Type 12
Case msoOLEControlObject
it = "an OLE Control Object. Type : " & .Type
'Type 13
Case msoPicture
it = "a embedded picture. Type : " & .Type
'Type 14
Case msoPlaceholder
it = "a text placeholder (title or regular text--" & _
"not a standard textbox) object." & _
"Type : " & .Type
'Type 15
Case msoTextEffect
it = "a WordArt (Text Effect). Type : " & .Type
'Type 16
Case msoMedia
it = "a Media object .. sound, etc. Type : " & .Type
With .LinkFormat
it = it & vbCrLf & " My Source: " & _
.SourceFullName
End With
'Type 17
Case msoTextBox
it = "a Text Box."
'Type 18 = msoScriptAnchor, not defined in PPT pre-2000 so we use the numeric value
'Case msoScriptAnchor
Case 18
it = " a ScriptAnchor. Type : " & .Type
'Type 19 = msoTable, not defined in PPT pre-2000 so we use the numeric value
'Case msoTable
Case 19
it = " a Table. Type : " & .Type
'Type 19 = msoCanvas, not defined in PPT pre-2000 so we use the numeric value
'Case msoCanvas
Case 20
it = " a Canvas. Type : " & .Type
'Type 21 = msoDiagram, not defined in PPT pre-2000 so we use the numeric value
'Case msoDiagram
Case 22
it = " a Diagram. Type : " & .Type
'Type 22 = msoInk, not defined in PPT pre-2000 so we use the numeric value
'Case msoInk
Case 22
it = " an Ink shape. Type : " & .Type
'Type 23 = msoInkComment, not defined in PPT pre-2000 so we use the numeric value
'Case msoInkComment
Case 23
it = " an InkComment. Type : " & .Type
'Type -2
Case msoShapeTypeMixed
it = "a Mixed object (whatever that might be)." & _
"Type : " & .Type
'Just in case
Case Else
it = "a mystery!? An undocumented object type?" & _
" Haven't found one of these yet!"
End Select
MsgBox ("I'm " & it)
End With
Next i
End Sub
作者: willson_62 发布时间: 2010-09-23
作者: laose 发布时间: 2010-09-24
作者: willson_62 发布时间: 2010-09-25
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28