Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
Hide form fields in printed form | Microsoft Word Help | |||
Auto Updating TOC in Protected Form | Microsoft Word Help | |||
Hide form fields in printed form | Microsoft Word Help | |||
Retain editable images and allow text boxes in a form PW protected | Microsoft Word Help | |||
Text boxes in protected Doc, form fields | Microsoft Word Help |