【发布时间】:2014-05-22 15:15:27
【问题描述】:
我在 Power Point 2010 中创建了一个下拉列表,在保存文档之前效果很好。我在 VBA 中使用了以下代码:
Sub AddItemsToSelectedListBox()
Dim oShape As Shape
Set oShape = ActiveWindow.Selection.ShapeRange(1)
With oShape.OLEFormat.Object
' Add items to the list
.AddItem ("Good")
.AddItem ("Better")
.AddItem ("Best")
' You could work with other properties of the list or combo box here as well
End With
End Sub
f5 + 关闭。
通过查看模式,下拉列表效果很好。但是,如果我保存我的 power point 文档(以 .pptm 格式)并重新打开演示文稿,则列表不再下拉。如果我输入 VBA,代码如下所示:
Sub AddItemsToSelectedListBox()
Dim oShape As Shape
Set oShape = ActiveWindow.Selection.ShapeRange(1)
With oShape.OLEFormat.Object
' Add items to the list
.AddItem ("Good")
.AddItem ("Better")
.AddItem ("Best")
' You could work with other properties of the list or combo box here as well
End With
End Sub
Private Sub ComboBox1_Change()
End Sub
ComboBox_Change() 部分是新的。 (为什么?) 有谁知道,如何生成一个在保存过程中幸存下来的下拉列表? 非常感谢你!!
【问题讨论】:
标签: vba drop-down-menu powerpoint office-2010