0
1つのボタンをクリックした後、すべてのコードが一度に実行されるaddin用のコードを1つ作成しました。しかし、今私は実行のための任意の1つのイベントを選択できるドロップダウンリストを作成したいと思います。以下はPowerPoint 2007でVBAを使用してアドインでドロップダウンリストを作成するにはどうすればよいですか?
ボタンの私のコードです:
Sub Auto_Open()
Dim oToolbar As CommandBar
Dim oButton As CommandBarButton
Dim MyToolbar As String
' Give the toolbar a name
MyToolbar = "Test"
On Error Resume Next
' so that it doesn't stop on the next line if the toolbar's already there
' Create the toolbar; PowerPoint will error if it already exists
Set oToolbar = CommandBars.Add(Name:=MyToolbar, _
Position:=msoBarFloating, Temporary:=True)
If Err.Number <> 0 Then
' The toolbar's already there, so we have nothing to do
Exit Sub
End If
On Error GoTo Errorhandler
' Now add a button to the new toolbar
Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)
' And set some of the button's properties
With oButton
.DescriptionText = "Test_dist"
'Tooltip text when mouse if placed over button
.Caption = "Trial"
'Text if Text in Icon is chosen
.OnAction = "TEST"
'Runs the Sub Button1() code when clicked
.Style = msoButtonIconAndWrapCaptionBelow
' Button displays as icon, not text or both
.FaceId = 1885
.TooltipText = "Test your presentation"
End With
' You can set the toolbar position and visibility here if you like
' By default, it'll be visible when created
oToolbar.Top = 50
oToolbar.Left = 150
oToolbar.Visible = True
NormalExit:
Exit Sub ' so it doesn't go on to run the errorhandler code
Errorhandler:
'Just in case there is an error
Resume NormalExit:
End Sub
感謝スティーブRindsberg –