![]() |
|
#1
|
|||
|
|||
|
Greetings,
I have a WORD document that contains Form Fields for the user to enter information. This document is repeatedly used from one shift to another, it contains information for shift turnover. I want to FORCE the user to enable macros so that when the user closes the document, it automatically creates a 'archive' copy of the file, with the current date/time in the file name, saved to a different folder, for retrieval if something got fouled up. I attempted to protect the document from any changes upon closing, and then upon opening, I would unprotect the document, then re-protect it allowing 'Filling in forms'. When I do this, all the fields reset to empty. I don't want the user to have to retype everything, only edit what might have changed in the last shift, then save it. Here is my code: Code:
Private Sub Document_Close()
With ThisDocument
.Unprotect Password:="pw"
.Protect Password:="pw", _
NoReset:=False, _
Type:=wdAllowOnlyReading, _
UseIRM:=False, _
EnforceStyleLock:=False
End With
End Sub
Code:
Private Sub Document_Open()
With ThisDocument
.Unprotect Password:="pw"
.Protect Password:="pw", _
NoReset:=False, _
Type:=wdAllowOnlyFormFields, _
UseIRM:=False, _
EnforceStyleLock:=False
End With
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Tab through fields on a form.
|
Keep on Ticking | Word | 1 | 06-23-2011 03:29 AM |
| Calculating Form Fields in Microsoft Word | wubba80 | Word | 1 | 06-25-2010 12:42 AM |
| Form Fields Problem | shogan | Word | 1 | 05-18-2010 01:01 AM |
| Form fields in Word messed up | mba | Word VBA | 0 | 02-07-2010 09:54 PM |
| Form Fields | questions | Word | 0 | 04-27-2009 10:48 AM |