Macro to Toggle All Document Field Codes On and OffLast reviewed: July 30, 1997Article ID: Q99954 |
The information in this article applies to:
SUMMARYUsing the WordBasic macro language, you can toggle all field codes on or off in a document. The following information outlines two methods for setting up a toggle field codes macro.
MORE INFORMATIONMethod 1 can be used to toggle field codes on and off by assigning the ViewFieldCodes command to a Toolbar button. Method 2 toggles the ViewFieldCodes in your document and displays a message on the status bar (either "Field Codes On" or "Field Codes Off").
Method 1 For Word 6.0, 7.0
Method 1 For Word 2.0
Method 2 For Word 2.0, 6.0, 7.0WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The following WordBasic macro toggles all field codes in the current document and prints the status of ViewFieldCodes in the status bar:
Sub MAIN Result = ViewFieldCodes() If Result = 0 Then ViewFieldCodes 1 Print "Field Codes On" Else ViewFieldCodes 0 Print "Field Codes Off" EndIf End SubFor information about how to do this in Word 97, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q159968 TITLE : Word 97: Macro to Turn All Field Codes On and Off REFERENCES"User's Guide," version 2.0, pages 723-725 "Microsoft Word for Windows and OS/2 Technical Reference," page 280 "Microsoft Word for Windows Technical Reference," page 103 Kbcategory: kbusage kbmacro KBSubcategory: |
Additional query words: wordbasic toolbar viewfieldcodes word6
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |