我无法找到如何在初始化用户类期间获取Ribbon Checkbox的属性(启用/禁用)的示例。如何在sub Class_Initialize()
中调用Checkbox的OnGetPressed
感谢。
答案 0 :(得分:0)
VBA的问题。
我有一节课:AlScheme
Option Explicit
Private vClearPrg As Boolean
Public Property Get ClearPrg() As Boolean
ClearPrg = vClearPrg
End Property
Private Sub Class_Initialize()
Call SetOptions_OnGetPressed(xxxxxxxxx, vClearPrg)
End Sub
模块:MyRibbon
Option Explicit
Dim MyScheme As AlScheme
Public Rib As IRibbonUI
Public Sub AutoExec()
Set oAppClass.oApp = Word.Application
End Sub
Sub RibbonOnLoad(ribbon As IRibbonUI)
Set Rib = ribbon
End Sub
Sub SetOptions_OnGetPressed(ByRef control As IRibbonControl, ByRef pressed As Variant)
Set MyScheme = New AlScheme
pressed = New AlScheme.ClearPrg
End Sub
XML:
checkBox id =" _clearFormat" label =" Clear Prg"的OnAction =" SetOptions" getPressed =" SetOptions_OnGetPressed"
如何在初始化用户类时获取属性ClearPrg? (标记为xxxxxxxxx) 或任何其他解决方案。
谢谢。