WD: Form Fields Lose Text When Protected for Forms |
Q119698
This article describes methods that allow you to:
Microsoft 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 a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please see the following page on the World Wide Web:
http://www.microsoft.com/partner/referral/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://support.microsoft.com/directory/overview.asp
Sub MAIN
Dim Dlg As ToolsProtectDocument
Dlg.NoReset = 1
n = Dialog(dlg)
If n = - 1 Then ToolsProtectDocument Dlg
End Sub
ToolsProtectDocument .Type = 2, .NoReset = 1
Sub MAIN
' Prevents cancellation of the macro.
DisableInput
' Unprotects the form.
' Note: include .DocumentPassword argument for password
' protected form.
ToolsUnprotectDocument
' Select body of document.
EditSelectAll
' Set language.
Language "English (US)"
' Go to start of document.
StartOfDocument
' Perform the spell check
ToolsSpelling
' Reprotect the document for forms without resetting fields.
' Note: include .DocumentPassword argument for password
' protected form.
ToolsProtectDocument .NoReset = 1, .Type = 2
End Sub
Word 6.x:
Sub MAIN
' Prevents cancellation of the macro.
DisableInput
' Unprotects the form.
' Note: include .DocumentPassword argument for password
' protected form.
ToolsUnprotectDocument
' Moves insertion point to top of document.
StartOfDocument
' Starts Spell Checker.
ToolsSpelling
' Reprotect the document for forms without resetting fields.
' Note: include .DocumentPassword argument for password
' protected form.
ToolsProtectDocument .NoReset = 1, .Type = 2
End Sub
For additional information, please see the following articles in the
Microsoft Knowledge Base:
Q110174 Preserving Text When Re-protecting a Form Without Macros
Q109757 WordBasic Examples: ToolsUnprotectDocument
"Microsoft Word User's Guide," version 6.0, pages 305-26
"Microsoft Word Developer's Kit," version 6.0, pages 783-785
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
Issue type : kbhowto
Technology : kbHWMAC kbOSMAC kbWordSearch kbWordMacSearch kbWord700Search kbZNotKeyword2 kbWord600Mac kbWord601aMac kbWord601Mac kbWord600 kbWord600a kbWord600c kbWord700 kbWord700a
|
Last Reviewed: December 30, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |