Reply
 
Thread Tools Display Modes
  #1   Report Post  
hnyb1
 
Posts: n/a
Default Protected Fields in an Online Form

I am attempting to create an "online form" by setting up a protected template
with text fields. A handful of these fields will only be used by one person,
while the rest will be filled in by many. Is there any way to protect those
fields to be filled in by the one user separately. In other words I will
protect the template with one password, but was hoping that just this one
user could access certain fields (possibly with a different password) within
the form, without knowing the password for the entire document. I am using
Word 2003 and have looked at Diane's series, but could not find any info on
this.
  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default

On Mon, 10 Jan 2005 09:07:03 -0800, "hnyb1"
wrote:

I am attempting to create an "online form" by setting up a protected template
with text fields. A handful of these fields will only be used by one person,
while the rest will be filled in by many. Is there any way to protect those
fields to be filled in by the one user separately. In other words I will
protect the template with one password, but was hoping that just this one
user could access certain fields (possibly with a different password) within
the form, without knowing the password for the entire document. I am using
Word 2003 and have looked at Diane's series, but could not find any info on
this.


There isn't anything built-in. I haven't tried this, but it ought to
work: Create a macro that asks for the special-user password and, if
it isn't correct, moves the cursor to the first non-special field.
Then set this as the entry macro for each of the special fields.

With this simple scheme, the special user would have to enter the
password for each special field, but that wouldn't be too hard if they
copied the password to the clipboard and used Ctrl+V to paste it into
each popup.

With some more macro logic, the special password would need to be
entered only once. I haven't really thought that part through yet.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
  #3   Report Post  
hnyb1
 
Posts: n/a
Default

Thank you so much for your thoughts. I am sorry it has taken me so long to
get back to you, got sidetracked a little. Is there any way I can get an
example of the script that requires a special-user password? I appreciate
the help!

"Jay Freedman" wrote:

On Mon, 10 Jan 2005 09:07:03 -0800, "hnyb1"
wrote:

I am attempting to create an "online form" by setting up a protected template
with text fields. A handful of these fields will only be used by one person,
while the rest will be filled in by many. Is there any way to protect those
fields to be filled in by the one user separately. In other words I will
protect the template with one password, but was hoping that just this one
user could access certain fields (possibly with a different password) within
the form, without knowing the password for the entire document. I am using
Word 2003 and have looked at Diane's series, but could not find any info on
this.


There isn't anything built-in. I haven't tried this, but it ought to
work: Create a macro that asks for the special-user password and, if
it isn't correct, moves the cursor to the first non-special field.
Then set this as the entry macro for each of the special fields.

With this simple scheme, the special user would have to enter the
password for each special field, but that wouldn't be too hard if they
copied the password to the clipboard and used Ctrl+V to paste it into
each popup.

With some more macro logic, the special password would need to be
entered only once. I haven't really thought that part through yet.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

  #4   Report Post  
Jay Freedman
 
Posts: n/a
Default

Here's a sample. See http://www.gmayor.com/installing_macro.htm if you
need to know how to put it in the template.

'------------------
Private PasswordSupplied As Boolean ' starts as False at each opening

Public Sub RequirePassword()
Dim TodaysPassword As String

If PasswordSupplied Then Exit Sub ' it was supplied before

TodaysPassword = "Santa" & Format(Now, "ddMM")
If InputBox$("Field password:") = TodaysPassword Then
PasswordSupplied = True
Else
' kick the cursor to first unprotected field
ActiveDocument.FormFields("Text3").Select
End If
End Sub
'------------------

In this example, the special password changes every day to include the
two-digit day and two-digit month at the end; for example, today it's
"Santa1801" and tomorrow it's "Santa1802". You can use a constant
sequence of characters, or get as fancy as you like.

The "Text3" needs to be changed to the name of the first form field
that isn't protected by the special password. That's where the cursor
will be forced if the entry isn't correct.

Once a user has entered the special password, they can enter any of
the fields in the document. That lasts until the document is closed;
the next time they open it, they have to enter the password again.

To prevent users from opening the macro editor and looking at the
special password, you can password-protect the macro code. After you
insert the macro, go to the VBA editor's Tools menu, click Project
Properties, go to the Protection tab, check the "Lock project for
viewing" box, and enter a password in duplicate. Warning: if you lose
the macro password, you won't be able to read it yourself. It's often
a good idea to keep a copy of the macro that isn't locked, and
distribute only the locked copy.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

On Tue, 18 Jan 2005 06:37:02 -0800, "hnyb1"
wrote:

Thank you so much for your thoughts. I am sorry it has taken me so long to
get back to you, got sidetracked a little. Is there any way I can get an
example of the script that requires a special-user password? I appreciate
the help!

"Jay Freedman" wrote:

On Mon, 10 Jan 2005 09:07:03 -0800, "hnyb1"
wrote:

I am attempting to create an "online form" by setting up a protected template
with text fields. A handful of these fields will only be used by one person,
while the rest will be filled in by many. Is there any way to protect those
fields to be filled in by the one user separately. In other words I will
protect the template with one password, but was hoping that just this one
user could access certain fields (possibly with a different password) within
the form, without knowing the password for the entire document. I am using
Word 2003 and have looked at Diane's series, but could not find any info on
this.


There isn't anything built-in. I haven't tried this, but it ought to
work: Create a macro that asks for the special-user password and, if
it isn't correct, moves the cursor to the first non-special field.
Then set this as the entry macro for each of the special fields.

With this simple scheme, the special user would have to enter the
password for each special field, but that wouldn't be too hard if they
copied the password to the clipboard and used Ctrl+V to paste it into
each popup.

With some more macro logic, the special password would need to be
entered only once. I haven't really thought that part through yet.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


  #5   Report Post  
hnyb1
 
Posts: n/a
Default

Thankyou!!!!

"Jay Freedman" wrote:

Here's a sample. See http://www.gmayor.com/installing_macro.htm if you
need to know how to put it in the template.

'------------------
Private PasswordSupplied As Boolean ' starts as False at each opening

Public Sub RequirePassword()
Dim TodaysPassword As String

If PasswordSupplied Then Exit Sub ' it was supplied before

TodaysPassword = "Santa" & Format(Now, "ddMM")
If InputBox$("Field password:") = TodaysPassword Then
PasswordSupplied = True
Else
' kick the cursor to first unprotected field
ActiveDocument.FormFields("Text3").Select
End If
End Sub
'------------------

In this example, the special password changes every day to include the
two-digit day and two-digit month at the end; for example, today it's
"Santa1801" and tomorrow it's "Santa1802". You can use a constant
sequence of characters, or get as fancy as you like.

The "Text3" needs to be changed to the name of the first form field
that isn't protected by the special password. That's where the cursor
will be forced if the entry isn't correct.

Once a user has entered the special password, they can enter any of
the fields in the document. That lasts until the document is closed;
the next time they open it, they have to enter the password again.

To prevent users from opening the macro editor and looking at the
special password, you can password-protect the macro code. After you
insert the macro, go to the VBA editor's Tools menu, click Project
Properties, go to the Protection tab, check the "Lock project for
viewing" box, and enter a password in duplicate. Warning: if you lose
the macro password, you won't be able to read it yourself. It's often
a good idea to keep a copy of the macro that isn't locked, and
distribute only the locked copy.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

On Tue, 18 Jan 2005 06:37:02 -0800, "hnyb1"
wrote:

Thank you so much for your thoughts. I am sorry it has taken me so long to
get back to you, got sidetracked a little. Is there any way I can get an
example of the script that requires a special-user password? I appreciate
the help!

"Jay Freedman" wrote:

On Mon, 10 Jan 2005 09:07:03 -0800, "hnyb1"
wrote:

I am attempting to create an "online form" by setting up a protected template
with text fields. A handful of these fields will only be used by one person,
while the rest will be filled in by many. Is there any way to protect those
fields to be filled in by the one user separately. In other words I will
protect the template with one password, but was hoping that just this one
user could access certain fields (possibly with a different password) within
the form, without knowing the password for the entire document. I am using
Word 2003 and have looked at Diane's series, but could not find any info on
this.

There isn't anything built-in. I haven't tried this, but it ought to
work: Create a macro that asks for the special-user password and, if
it isn't correct, moves the cursor to the first non-special field.
Then set this as the entry macro for each of the special fields.

With this simple scheme, the special user would have to enter the
password for each special field, but that wouldn't be too hard if they
copied the password to the clipboard and used Ctrl+V to paste it into
each popup.

With some more macro logic, the special password would need to be
entered only once. I haven't really thought that part through yet.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org





  #6   Report Post  
Jay Freedman
 
Posts: n/a
Default

Jay Freedman wrote:
....

In this example, the special password changes every day to include the
two-digit day and two-digit month at the end; for example, today it's
"Santa1801" and tomorrow it's "Santa1802". You can use a constant
sequence of characters, or get as fancy as you like.


Correction, "Santa1901" instead of "Santa1802". Maybe that particular scheme
isn't such a good idea...

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide form fields in printed form BP522 Microsoft Word Help 6 January 11th 05 04:46 PM
Auto Updating TOC in Protected Form Scott Cooper Microsoft Word Help 2 January 9th 05 02:32 AM
Hide form fields in printed form BP522 Microsoft Word Help 1 January 6th 05 02:58 PM
Retain editable images and allow text boxes in a form PW protected Shannon Microsoft Word Help 2 December 8th 04 03:37 PM
Text boxes in protected Doc, form fields BP522 Microsoft Word Help 5 December 3rd 04 07:55 PM


All times are GMT +1. The time now is 05:13 AM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"