CustomizationContext : Confused

D

dvnova

Hi there,

Software: Word 2000

I have producing a template, and I want to write some VBA to hide some
CommandBars.

I want these commandbars to be disabled when anybody develops a new
document based on my template, however they should be present if a new
document based on the Normat.dot is opened.

I have developed a new Class that takes care off all the work I want
to do with CommandBars and Menus and such, and within one of the
Subroutines have have coded:

' --- VBA CODE

CustomizationContext = ActiveDocument.AttachedTemplate
CommandBars("Tables and Borders").Enabled = False

' --- END VBA CODE

This works just as expected with the new document based on my
template, however if I then open a new document based on the
Normal.dot the "Tables and Borders" CommandBar is still missing and
can cannot be selected from VIEW | TOOLBARS either.

Is this not what I require. I need any changes to the CommandBar to
be made to documents based on my template only.

Can somebody help me understand what is going wrong?

Cheers
Donald
 
W

Word Heretic

G'day (e-mail address removed) (dvnova),

Test if the template is not yours and show the toolbar.

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


dvnova reckoned:
 
D

dvnova

Cheers for the reply mate, however I'm not 100% sure what you mean
when you wrote below:
Test if the template is not yours and show the toolbar.

Don't suppose you can clarify this.

Very much appreciated.

Regards
Donald

================================
 
D

dvnova

Also what I have noticed, which I am not too sure should be the case
or not, is:

If I open a new document based on my template which removes the
CommandBars, then the menus are successfully removed, but as I
mentioned before if I open a new doc based on the NormalTemplate those
menus are also missing...

....but what I have discovered is...

....this is only the case when I have the other document (based on my
template) open at the same time. If I close any documents based on my
template then any new documents based on the NormalTemplate are
returned to normal with all the CommandBars visible and enabled.

Surely it cannot be the case that while people are using my template
they cannot open any new NormalTemplate documents because the menus
will be missing?

CustomizationContext must be easier than this....

More advice needed....

Cheers again
Donald


======================================
 
W

Word Heretic

G'day (e-mail address removed) (dvnova),

Inside the same routine, you wrap it like this:

if my template
hide the sucker
do other stuff
else
show the sucker
end if

Steve Hudson - Word Heretic
Want a hyperlinked index? S/W R&D? See WordHeretic.com

steve from wordheretic.com (Email replies require payment)


dvnova reckoned:
 

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