
Toolbar button change caption
Hi Steve,
The usual way for this kind of "on/off" button would be to use one
Caption or button face, and make the button look pressed/depressed
(like the buttons for "bold"/"italic"...).
But changing the text is also possible.
The following example should show you which properties to look up in
the online help:
Dim myCBB As CommandBarButton
Set myCBB = CommandBars.ActionControl
myCBB.Caption = "Track: Yes"
myCBB.State = msoButtonDown
Regards,
Klaus - Word MVP
Quote:
> I have toolbar buttons to toggle "Track Changes", "Show
> changes" and "Print Changes" off and on. For example, on
> the "Track Y/N" button:
> Sub TrackChangesToggle()
> With ActiveDocument
> If .TrackRevisions = True Then
> .TrackRevisions = False
> Else
> .TrackRevisions = True
> End If
> End With
> End Sub
> It's easy to tell if the "Show Changes" is on just by
> looking at the document. However, I want to change the
> caption of the other two so I know which way the toggle is
> set. So instead of "Track Y/N" I would show either "Track
> Y" if true or "Track N" if false.
> I lieu of this, can you change the text or button color to
> show green if true, or red if false?
> Finally, with the buttons on my normal template, how can I
> be sure the buttons updated to show the correct status
> when I bring up an existing document?
> Thanks