How to add my addin toolbar into Customize Dialog?

H

Hurry Wood

I developed a addin for ms word 2k. I am afraid of the user that drag my
addin buttons off the commandbar to remove such buttons from my addin
toolbar. So, how to add my addin toolbar and such buttons into Customize
Dialog just as build-in menu and toobar buttons?
 
T

Tom Winter

I don't think you can add them to any of the built-in categories, but you
can make stuff show up in the macros section. You just have to have a public
macro with no parameters that's in a global templates (.DOT add-in). That'll
show up in the macros section, though it will always have the "macro" image.

Others may have some other ideas.
 
C

Cindy M -WordMVP-

Hi Hurry,
I developed a addin for ms word 2k. I am afraid of the user that drag my
addin buttons off the commandbar to remove such buttons from my addin
toolbar.
You should be able to set the Protection property for the toolbar so that
the users can't modify it:

CommandBars(index).Protection = msoBarNoCustomize

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
H

Hurry Wood

Thank you Cindy, it is figured out :)

I have another question for commandbar. I make the buttons visible or
invisible in my commandbar programmelly. But it looks that the commandbar UI
responds the change immediately only in the first the instance of Word, it
means that the subsequent instances do not respond the change soon. Is any
method for that?


Hurry
 
H

Hurry Wood

Hi Cindy,

Thanks for your resolvent, it works :)

I have another question for commandbar. I attempt to modify the my
commandbar programmlly. I found that the commandbar responds the change
immediately only in the first instance (document) of MS Word. It means that
the subsequent instances do not respond the chage soon. Is any method for
that?

Thanks,
Hurry
 
C

Cindy M -WordMVP-

Hi Hurry,
I have another question for commandbar. I attempt to modify the my
commandbar programmlly. I found that the commandbar responds the change
immediately only in the first instance (document) of MS Word. It means that
the subsequent instances do not respond the chage soon. Is any method for
that?
I'm not certain... Have you set a unique value for the TAG property of each
commandbar and commandbar button? If not, do so and see if that helps.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
H

Hurry Wood

Hi Cindy,

Yes, I have set unique value for the TAG property of them. I currently store
the pointers to the CommandButton that retrieved in OnConnection(..), then
modify the state of buttons with them.
Should I retrieve CommandBars from ActiveDocument for speeding up the
responding of my command bar?
 
C

Cindy M -WordMVP-

Hi Hurry,
Yes, I have set unique value for the TAG property of them. I currently store
the pointers to the CommandButton that retrieved in OnConnection(..), then
modify the state of buttons with them.
Should I retrieve CommandBars from ActiveDocument for speeding up the
responding of my command bar?
I'd say this depends on how you're setting the CustomizationContext to begin
with. And how you're setting it before you try making such a change.

CommandBars are always stored SOMEWHERE, and with Word you MUST specify that
place before sending any commands that will change them.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
H

Hurry Wood

Hi Cindy,

Thank you for your help, do you mean that I should do this
"CustomizationContext = ActiveDocument" first every time I wanna make
changes to CommandBar in current active document?
 
C

Cindy M -WordMVP-

Hi Hurry,
do you mean that I should do this
"CustomizationContext = ActiveDocument" first every time I wanna make
changes to CommandBar in current active document?
Yes, when the changes aren't consecutive. You don't need it in every
second code line. But you do need it, say, at the top of any procedure
that will be making changes to the CommandBar.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top