Jfp87
03-28-2017, 01:10 AM
Guys,
I have a custom ribbon with a toggle button that highlights Content Controls. If I have multiple documents open, how do I force the ribbon button to be toggled across all documents? I.e. you have two open documents and you toggle the setting it one but it affects both.
Public myRibbon As IRibbonUI
'Callback for Toogle onActionSub ToggleonAction(control As IRibbonControl, pressed As Boolean)
Select Case control.ID
Case Is = "Grp1TB1"
If p_bHighlight Then
p_bHighlight = False
Else
p_bHighlight = True
End If
modMain.HighlightVariables
Case Else
'Do nothing
End Select
'Force the ribbon to redefine the control with correct image and label
myRibbon.InvalidateControl control.ID
End Sub
Will I need to declare multiple ribbon instances?
Joe
I have a custom ribbon with a toggle button that highlights Content Controls. If I have multiple documents open, how do I force the ribbon button to be toggled across all documents? I.e. you have two open documents and you toggle the setting it one but it affects both.
Public myRibbon As IRibbonUI
'Callback for Toogle onActionSub ToggleonAction(control As IRibbonControl, pressed As Boolean)
Select Case control.ID
Case Is = "Grp1TB1"
If p_bHighlight Then
p_bHighlight = False
Else
p_bHighlight = True
End If
modMain.HighlightVariables
Case Else
'Do nothing
End Select
'Force the ribbon to redefine the control with correct image and label
myRibbon.InvalidateControl control.ID
End Sub
Will I need to declare multiple ribbon instances?
Joe