Put XmlNode in ReadOnly ?

X

Xavier Lelievre

Hi,

I develop with Visual studio 2005 with VSTO

I have a xml schema in word document
I put my xmlnodes in a row of a word table.

I use the taskpane to modify my nodes and I don't want users modify nodes
directly.

Is it possible to put some node (a cell in a word table which contains a xml
node) in readonly ?


An other thing, is it possible not to authorize the adding rows in a word
table when the tab key is selected by the user when he is on the last row ?

Thank's in advance

Xavier
 
C

Cindy M -WordMVP-

Hi Xavier,
I develop with Visual studio 2005 with VSTO

I have a xml schema in word document
I put my xmlnodes in a row of a word table.

I use the taskpane to modify my nodes and I don't want users modify nodes
directly.

Is it possible to put some node (a cell in a word table which contains a xml
node) in readonly ?
Use the menu command Tools/Protect and note the "read-only" form of protection.
This works similarly to Excel's protection: you select the text users are
allowed to change, then activate "Everyone". Once protection is activated, the
rest of the document is locked.

Generally, then, it's also locked when writing to the document using
automization (the Word object model). But you can, for the period when the code
is executing, remove the protection then reinstate it after writing to the
document.

In order to get the basic syntax you require for unprotecting / reprotecting
you can record a macro in the Word environment.

Note: this type of protection is only available in Word 2003. If you ever
encounter a similar requirement when working with older versions your only
possibility is to protect as a form.
An other thing, is it possible not to authorize the adding rows in a word
table when the tab key is selected by the user when he is on the last row ?
If the entire table is protected, then this issue will not occur.

If the last cell of a table must be left available for editing, just click in
the cell and activate "Everyone". Since the rest of the table is not enabled
for editing, pressing TAB will not expand the table.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
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