【发布时间】:2010-04-06 16:55:35
【问题描述】:
我想为 PowerPoint 2003 创建一个向工具栏添加按钮的插件。 我该怎么做?
【问题讨论】:
标签: vba ms-office add-in powerpoint
我想为 PowerPoint 2003 创建一个向工具栏添加按钮的插件。 我该怎么做?
【问题讨论】:
标签: vba ms-office add-in powerpoint
创建一个新模块并添加以下自动打开功能。 您需要在 addins 文件夹中将文件另存为 ppa。
Sub Auto_open()
Dim oToolbar As CommandBar
Dim oButton As CommandBarButton
'Create the toolbar
Set oToolbar = CommandBars.Add(name:="CommandbarName", Position:=msoBarTop)
'Add the first button
Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)
With oButton
.Caption = "New button"
.OnAction = "FunctionTocall"
.Style = msoButtonIconAndWrapCaption
.FaceId = 11 'icon
End With
End Sub
【讨论】:
如果您的目标是 PowerPoint 2007,请查看 Robert Green,创建应用程序级插件以自动执行常见 Office 任务
【讨论】: