The information in this article applies to:
SUMMARY
This article describes methods that allow you to:
MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/supportnet/refguide/ Method 1: Alter the Protect/Unprotect Command FunctionalityThe following macros protect your form without causing you to lose the text that you entered into a form field. The macro can be stored in the actual form template, to allow you to manually unprotect and reprotect the form while preserving the form field contents.If you name this macro "ToolsProtectDocument," then when you click on Protect Document on the Tools menu to protect your document for forms, the created macro will run instead of Word's built-in command of the same name.
Method 2: Create a Macro to Protect/Unprotect Your DocumentThe following example protects the active document for forms without resetting the contents of the form fields. Create the macro and assign the macro to a key, menu or toolbar button for easy access.
Method 3: Unprotect, Check Spelling or Update a Field, Reprotect a DocumentIn Word 7.x and later, the form field text is formatted for No Proofing. Use the following macro to temporarily Unprotect the form, change the language of the form fields, perform a spell check or update a field, and reprotect the form while preserving the text you've typed into the form fields. You can use this macro as an On Exit macro for the last form field so that you can check the spelling or update a field before you save the form.Word 7.x:
Word 6.x:
For additional information, please see the following articles in the
Microsoft Knowledge Base:
Q110174 Preserving Text When Re-protecting a Form Without Macros REFERENCES
"Microsoft Word User's Guide," version 6.0, pages 305-26
Additional query words: form field forms protect Unprotect lose lost text preserve retain keep update formfield formtext available spell
Keywords : kbmacro kbdtacode kbmacroexample winword macword word6 word7 word95 |
Last Reviewed: September 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |