【发布时间】:2021-03-13 10:39:47
【问题描述】:
我想在 PowerPoint ppam 中使用来自某些自定义 XML 的 getLabel 回调,以便本地化功能区中的文本。我担心这样做可能会导致在启动 PowerPoint 时不时出现错误消息(“PowerPoint 无法启动此功能,因为您当前有一个 Visual Basic for Applications 项目处于中断模式。”)users have experienced with an add-in that uses a getEnabled callback。我有already asked a question about other options for localising the ribbon。
您是否在 PowerPoint ppam 加载项中使用 getLabel?如果是这样,您有时会在 PowerPoint 启动时看到此错误消息吗?此外,您是否使用 getEnabled,这是否会导致 PowerPoint 启动时显示此错误消息?
无论哪种方式的答案都会很棒。
这是我正在测试的:
自定义 UI XML 片段:
<button id="app1ShowAMsg"
imageMso="TableInsert"
size="normal"
onAction="app1ShowAMessage"
label="app1GetLabel"/>
VBA 代码:
Public Sub app1GetLabel(control As IRibbonControl, ByRef returnedVal)
Select Case control.Id
Case "app1ShowAMsg"
returnedVal = "My added label"
End Select
End Sub
Public Sub app1ShowAMessage()
MsgBox "You clicked a button."
End Sub
【问题讨论】:
标签: vba powerpoint ribbonx