Results 1 to 2 of 2
Thread: Add active buttons to menubar
2002-04-15, 10:11 #1
- Join Date
- Feb 2002
- Thanked 0 Times in 0 Posts
Add active buttons to menubar
I want to insert four buttons on my menubar which indicate whether I'm printing double sided, double sided toner reductive, single sided, single sided toner reductive.
That is not the problem, my problem is that I want to have an indication when the button is selected - just like the buttons for Bold, Italic etc.
Is this possible at all?
2002-04-15, 11:13 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
Re: Add active buttons to menubar
You can do this in code.
To give you an idea, here is an example of a simple macro. It is assigned to a toolbar button named "Test" on a toolbar named "myBar".
Dim oBtn As CommandBarButton
Set oBtn = CommandBars("myBar").Controls("Test")
If Selection.Range.Bold = True Then
oBtn.State = msoButtonUp
Selection.Range.Bold = False
oBtn.State = msoButtonDown
Selection.Range.Bold = True
For this to work, a reference to the Microsoft Office x.0 Object Library must be set (it usually is in Word VBA I believe; if not, select Tools/References in the Visual Basic editor, look for the Microsoft Office x.0 Object Library and make sure it's checked)
For a real application, you need to do a lot of checking to ensure that the button is in the right state all the time.
In your case, you'll need something to turn the button "off" when printing is finished.