Locking the data in Field(Custom Document Property)

M

M.L.Srinivas

HI

Can we lock the data in the field (created thru
customdocproperty) so that i force the user to change the
value thru my interface only instead making the change in
ms-word window.

Thanks
M.L.Srinivas
 
M

M.L.Srinivas

Hi Jezebel,

I didn't get you, can you please explain.

Thanks for your time

M.L.Srinivas
 
J

Jezebel

Read Help on DocumentVariables. They are similar to DocumentProperties --
arbitrary values stored as part of the document file -- and you can insert
them into the document with fields (DocVariable in place of DocProperty);
but you can set them only via VBA. An ordinary user (who knows no VBA) can
change them only if you provide them with code to do so.
 
W

Word Heretic

G'day "M.L.Srinivas" <[email protected]>,

Put your data into a Document Variable (in the VBA help) instead of a
Cust Doc Prop and users have to write VBA to change it instead of
using the native Word GUI.

Another way is to be tricky with protecting SECTIONS of your doc
(continuous sect breaks are priceless here) so they cant touch it.



M.L.Srinivas said:
Hi Jezebel,

I didn't get you, can you please explain.

Thanks for your time

M.L.Srinivas

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 
M

M.L.Srinivas

Hi Jezebel,

Thanks for your reply.

I tried Document Variables in place custom doc properties
and to my surprise..both are behaving in the same manner.

Once inserted in the doc with some value thru vba...the
user is able to type/change the value directly in Word GUI.

May be when we read the variable value from vba..it might
show the value send from vba ..but in the document the
value is some other thing..that's why i want to lock them
so that the user will be forced to change the value thru
the interface given but not directly type in Word GUI.

Please suggest me a way out and once again thanks for the
reply.


M.L.Srinivas
 
J

JGM

Hi M.L.

As you found out, what Jezebel meant was that Document Variables cannot be
changed directly in the document. You need VBA to change their values. But
once their values are inserted in the document through a field, the user can
naturally delete then, replace them, etc. just like he would be able to with
any other field or text element.

As far as "locking" down something on the page (be it a field containing a
doc variable value, a field containing a custom property value, a field
containing today's date, an image or just some plain text...) it cannot be
done unless you use protected forms.
And even then, it will not be 100% secure...

I guess your best bet would be to look into protecting the document as a
form by selectively choosing which sections to protect, if you do not want
to protect the whole document...

HTH
Cheers!
 

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