【问题标题】:Is getLabel safe to use (VBA, PowerPoint)?getLabel 可以安全使用(VBA、PowerPoint)吗?
【发布时间】: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


    【解决方案1】:

    是的,是的。与其他人一起使用getLabel 回调时,我没有看到任何奇怪的地方。此外,这是在 Fluent UI 上实现任何动态的推荐方法 - 用于在运行时更改标题字符串等。 Fluent UI 在以下系列文章中有深入介绍:

    此外,您可能会发现以下文章对您有所帮助:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-20
      • 2010-10-11
      • 2013-01-06
      • 2016-04-28
      • 2021-05-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多