D
damezumari
I have code that puts a button on the Tools menu:
CustomizationContext = ActiveDocument.AttachedTemplate
With CommandBars("Menu Bar").Controls("Tools").Controls
Set mybutton = .Add(Type:=msoControlButton)
'mybutton.BeginGroup = True ' gives a separator above the button
mybutton.FaceId = 990 ' 2174 ' 7391
mybutton.Caption = "AutoFooter is On"
mybutton.OnAction = "MacroOn"
mybutton.Visible = True
End With
To display the caption I can use:
CommandBars("Menu Bar").Controls("Tools").Controls("AutoFooter is
On").Caption
But, if I want the user to be able to toggle the caption to "AutoFooter
is Off", how can I then test which caption it has?
I use Word 2003 and Win2000.
Regards,
Jan Nordgreen
CustomizationContext = ActiveDocument.AttachedTemplate
With CommandBars("Menu Bar").Controls("Tools").Controls
Set mybutton = .Add(Type:=msoControlButton)
'mybutton.BeginGroup = True ' gives a separator above the button
mybutton.FaceId = 990 ' 2174 ' 7391
mybutton.Caption = "AutoFooter is On"
mybutton.OnAction = "MacroOn"
mybutton.Visible = True
End With
To display the caption I can use:
CommandBars("Menu Bar").Controls("Tools").Controls("AutoFooter is
On").Caption
But, if I want the user to be able to toggle the caption to "AutoFooter
is Off", how can I then test which caption it has?
I use Word 2003 and Win2000.
Regards,
Jan Nordgreen