I'm sorry, Klaus,
That's not the problem. "visible" is a parameter of a function, wherewith I
wuold like to mke the button visible or invisible. The full code is:
Sub SetButtonVisible(caption As String, visible As Boolean)
For Each ctl In CommandBars("formatting").Controls
If ctl.caption = caption Then
ctl.visible = visible
End If
Next ctl
End Sub
The sub works ok for setting a button invisible. But when resetting visible
the button appears not in the collection
For Each ctl In CommandBars("formatting").Controls
So the question is how to get the invisible buttons in the collection.
Greetings,
Henk
> Hi Henk,
>
[quoted text clipped - 23 lines]
> >
> > Henk
Klaus Linke - 24 Aug 2005 15:35 GMT
> So the question is how to get the invisible buttons in the collection.
Shouldn't make a difference whether they are visible or not.
Perhaps single-step, or try to put a
Debug.Print ctl.caption
in the loop to see if all controls are looped?
Or check CommandBars("Formatting").Controls.Count?
Regards,
Klaus
> I'm sorry, Klaus,
> That's not the problem. "visible" is a parameter of a function, wherewith
[quoted text clipped - 46 lines]
>> >
>> > Henk