I have a template which includes formfields. When a document is created from
that template and completed. Is it possible to lock the enture document and
it's contents to prevent the content being altered without a password?

Signature
Mark
Mark - 19 Jun 2006 19:22 GMT
Sorry forgot to mention this needs to be for Office 97 +
Mark
> I have a template which includes formfields. When a document is created from
> that template and completed. Is it possible to lock the enture document and
> it's contents to prevent the content being altered without a password?
Doug Robbins - Word MVP - 19 Jun 2006 20:48 GMT
Yes

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I have a template which includes formfields. When a document is created
>from
> that template and completed. Is it possible to lock the enture document
> and
> it's contents to prevent the content being altered without a password?
Mark - 19 Jun 2006 22:04 GMT
Hi Doug,
Would it possible to enlighten me please? :-)

Signature
Mark
> Yes
>
[quoted text clipped - 3 lines]
> > and
> > it's contents to prevent the content being altered without a password?
Charles Kenyon - 20 Jun 2006 01:31 GMT
1) Go to office.
2) Sit down in chair in front of computer.
3) Turn on computer and log in if needed.
4) Start Word program.
5) Open your form template so it is on your screen.
6) Use the menus: Tools > Protect Document > For Forms
7) Set a password
8) Close and save the template.
What you are talking about is what Word calls an "online form." Check this
in help. For more about online forms, follow the links at
http://addbalance.com/word/wordwebresources.htm#Forms or
http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm especially Dian
Chapman's series of articles. You may also want to look at
http://www.word.mvps.org/FAQs/TblsFldsFms/LinesInForms.htm.
Hope this helps,

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
My criminal defense site: http://addbalance.com
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
>I have a template which includes formfields. When a document is created
>from
> that template and completed. Is it possible to lock the enture document
> and
> it's contents to prevent the content being altered without a password?
Mark - 20 Jun 2006 19:33 GMT
Charles,
Thanks for your response, as you can see another MVP has supplied me with
the appropriate help.

Signature
Mark
> 1) Go to office.
> 2) Sit down in chair in front of computer.
[quoted text clipped - 18 lines]
> > and
> > it's contents to prevent the content being altered without a password?
Cindy Meister - 20 Jun 2006 09:32 GMT
(Note: Word 97 and later)
You're asking this in a developer newsgroup, so I'm assuming you're looking
for a macro solution. You basically have two choices.
- Unprotect the document, turn all fields into static text
(ActiveDocument.Fields.Unlink) then reprotect. This would require keeping the
password in the macro code.
- Set each form field to NOT be enabled for user input. This can be done
without changing document protection, but would require cycling through all
the form fields. Roughly
For each ffld in ActiveDocument.Formfields
ffld.Enabled = false
Next
IMPORTANT REMARK: Form field protection is only marginally "safe". Anyone
can get around it by using Insert/File to bring the form into a new document,
where the protection is not in-force. There is NO stricter protection option
available in Word 97 or 2000.

Signature
-- Cindy
> I have a template which includes formfields. When a document is created from
> that template and completed. Is it possible to lock the enture document and
> it's contents to prevent the content being altered without a password?
got questions - 27 Mar 2008 17:46 GMT
Lenny wrote: regarding your response for form field NOT be enabled for user
input...
Cindy, do I correctly understand that once the code is activated, say after
the user has entered information into the fields that the code would make it
impossible for another user to delete or alter text in these fields? If so -
can the code be written to include specific sections of a form template? As
example: could this be applied to disable user entry into all fields in
specific sections? Also - could you then use the reverse of the vb to
'enable' entry again? Regards
> (Note: Word 97 and later)
>
[quoted text clipped - 19 lines]
>> that template and completed. Is it possible to lock the enture document and
>> it's contents to prevent the content being altered without a password?
fumei - 27 Mar 2008 18:14 GMT
"could this be applied to disable user entry into all fields in specific
sections? "
Yes, by doing it by Section. Say you have formfields in Section 1 and
Section 2. The document is protected for forms, with ALL formfields are
active (and enabled).
Say the user puts in information into the formfields in both Section 1 and
Section 2.
Sub SpecificSection()
Dim oFF As FormField
For Each oFF In ActiveDocument.Sections(1).Range _
.FormFields
oFF.Enabled = False
Next
For Each oFF In ActiveDocument.Sections(2).Range _
.FormFields
oFF.Enabled = True
Next
End Sub
Would now permit users to alter/change the formfields in Section 2 (enabled =
True) but not Section 1 (enabled = False).
The questions is, though, where/when would you execute the above code? You
could do it as the OnExit macro for the last formfield in Section 2. That is,
the user puts something into the last formfield in Section 2, and boom...
Section 2 is enabled but Section is disabled.
The problem with that is the user could easily do the last formfield in
Section 2 before anything else...before putting something into Section 1.
You could add testing that checks first (have Section 1 formfields been
filled?), but that would greatly add to the logic.
>Lenny wrote: regarding your response for form field NOT be enabled for user
>input...
[quoted text clipped - 11 lines]
>>> that template and completed. Is it possible to lock the enture document and
>>> it's contents to prevent the content being altered without a password?
got questions - 27 Mar 2008 18:24 GMT
lenny wrote: fumei, could this not be placed into an entry macro to a check
box? As example:
[ ] Click to Lock Comments where the code is activated when the user clicks
on the check box?
regards...
>"could this be applied to disable user entry into all fields in specific
>sections? "
[quoted text clipped - 39 lines]
>>>> that template and completed. Is it possible to lock the enture document and
>>>> it's contents to prevent the content being altered without a password?