Group:  Microsoft Word ยป microsoft.public.word.vba.customization
Thread: HOWTO Add a button to Word's current toolbar.

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

HOWTO Add a button to Word's current toolbar.
ATS 21.07.2006 19:01:02
HOWTO Add a button to Word's current toolbar.

Please help,

I'm using VC++ and I want to add a button to a Word toolbar. I want the
button to invoke a macro I make on the fly, but first I need to gett he
button there. The difficulties I see are as such:

1) Given the Application object, how do I find which tool bars (or command
bars) are currently up?

2) Are there "default" Word toolbars that should always be available, so I
do not have to loop through all toolbars to find one I can use?

3) Can I add a toolbar button to the main menu bar where things like the
"File Meno" reside?


Re: HOWTO Add a button to Word's current toolbar.
"Jean-Guy Marcil" <NoSpam[ at ]LeaveMeAlone> 21.07.2006 21:12:13
ATS was telling us:
ATS nous racontait que :

[Quoted Text]
> HOWTO Add a button to Word's current toolbar.
>
> Please help,
>
> I'm using VC++ and I want to add a button to a Word toolbar. I want
> the button to invoke a macro I make on the fly, but first I need to
> gett he button there. The difficulties I see are as such:
>
> 1) Given the Application object, how do I find which tool bars (or
> command bars) are currently up?

Check each commandBar Visible value


> 2) Are there "default" Word toolbars that should always be available,
> so I do not have to loop through all toolbars to find one I can use?

The only one you can almost be certain that will be there all the timne is
the menu bar.

Dim myMenuBar As CommandBar
Set myMenuBar = CommandBars.ActiveMenuBar

Which returns an object pointing to the menu bar.

> 3) Can I add a toolbar button to the main menu bar where things like
> the "File Meno" reside?

Yes. But this is a VBA group. I do not know how you would do this with VC++



--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE[ at ]CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org


Re: HOWTO Add a button to Word's current toolbar.
ATS 24.07.2006 16:53:02
Thanks Jean-Guy for the reply. I will try these things.

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net