Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-15-2011, 04:59 AM
PosseJohn PosseJohn is offline Preventing Form Fields to Reset Windows XP Preventing Form Fields to Reset Office 2007
Novice
Preventing Form Fields to Reset
 
Join Date: Jul 2011
Posts: 20
PosseJohn is on a distinguished road
Default Preventing Form Fields to Reset

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
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Preventing Form Fields to Reset 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:01 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft