|
|
|
date: Tue, 23 Sep 2008 09:44:02 -0700,
group: microsoft.public.word.vba.general
back
Re: Remove everything from formatting toolbar, other than Style dropdo
I don't have an English Word handy to test, but it probably should be
.Commandbars("Formatting").Controls("Font:").Visible = False
Using the name (caption) of the control to access it is a bit messy.
It's safer to use the Id, say
Dim myControl As CommandBarControl
For Each myControl In CommandBars("Formatting").Controls
If myControl.ID = 1728 Then ' 1728 = Font dropdown
MsgBox myControl.Caption
myControl.Visible = False
End If
Next myControl
The styles dropdown has the Id 1732, so you could change the above code to
If myControl.ID <> 1732 Then ' 1732 = Styles dropdown
myControl.Visible = False
End If
to achieve your goal.
BTW, "With ActiveDocument" was probably just for testing... since you say
you want to customize the commandbar in your template?
Regards,
Klaus
"Someone" wrote:
> Hello,
>
> I'm trying to create a template, so that when it is opened, the only
> option
> to appear in the formatting toolbar is the Style dropdown (all of the
> other
> options are hidden in the formatting toolbar). I've been trying with the
> following lines for each function in the formatting toolbar and they don't
> work.
>
> With ActiveDocument
> .Commandbars("Formatting").Controls("Font").Visible = False
> End with
>
> I was hoping someone can help.
>
> Thanks in advance.
date: Tue, 23 Sep 2008 19:22:18 +0200
author: Klaus Linke
|
|