Vanished menu options...

W

wilsond

I disabled the Word 2003 File|Open menu option through automation code in C#
for an application I'm writing. Upon exiting the application, I re-enable the
option. I put a "pause" in the program so that I can look at the Word menu
before the app closes the Word instance and I can see that it got back to
being enabled. But when I start up Word by itself, the File|Open menu option
is disabled.

The application will ultimately disable several menu options. Those menu
options need to be re-enabled so that if a user wants to use Word by itself,
those options are available. Anyone got any ideas why it keeps saving the
settings from the app??

Additionally, I need to disable some shortcut keys. Like CTRL + O, CTRL + S,
etc. I understand the only way to do this is through code in a document. Can
someone give me an example snippet of code on how to do this?

David
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?d2lsc29uZA==?=,
I disabled the Word 2003 File|Open menu option through automation code in C#
for an application I'm writing. Upon exiting the application, I re-enable the
option. I put a "pause" in the program so that I can look at the Word menu
before the app closes the Word instance and I can see that it got back to
being enabled. But when I start up Word by itself, the File|Open menu option
is disabled.
You MUST set the CustomizationContext everytime you run a procedure that
affects CommandBars or KeyBindings. Word can save these things in any loaded
template, as well as the active document. If you don't tell it where to make
the changes, Word will do whatever it likes, which is likely to be what you
don't expect. And it's not said that the changes will always be made to the
same context.
Additionally, I need to disable some shortcut keys. Like CTRL + O, CTRL + S,
etc. I understand the only way to do this is through code in a document. Can
someone give me an example snippet of code on how to do this?
I think we're carrying on this conversation in another, parallel thread, but...

KeyBindings is what you need to look up in the object model to programmatically
control keyboard assignments. Same remark about customizationcontext.

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