The information in this article applies to:
SUMMARYUsing the Microsoft WordBasic MacroCopy statement, an editable macro can be changed to an execute-only macro. After a macro is changed to execute-only status, you cannot open the macro for editing or viewing purposes. When a macro is changed to execute-only, the Edit button in the Macro dialog is unavailable (greyed) when the macro name is selected. The execute-only option was introduced in Word version 2.0 for Windows and is used to protect macros from being modified. MORE INFORMATION
Prior to changing a macro to execute-only status, make a backup copy
of the macro text in another file. After you change the status to
execute-only, the macro is no longer editable.
If you don't specify a source or destination template, the Normal
template is assumed. The following macro instruction copies the
FileNew macro from the TEMP.DOT file to FileNew in the NORMAL.DOT
template file. The "ExecuteOnly" parameter is a value other that
zero; therefore, the FileNew macro is given execute-only status in
the NORMAL.DOT template file.
NOTE: A macro cannot change itself to execute-only status. You must run the
MacroCopy command from another macro to change a macro to execute-only
status.
You cannot have the macro name listed in the MacroCopy command open for editing when you run the MacroCopy command. For example, when running the following macro
you cannot open the macro named "FileMac" in the macro editor.
After you change a macro to execute-only status, you cannot access the macro-editing window. The macro is not compiled or specially encrypted. Macro keywords are always compressed to three-byte tokens in order to save space, but literal strings (subroutine and function names and comments) are stored as text in the template file and are visible using a file reader. For more information on the MacroCopy function, search for "WordBasic Programming Language" and "MacroCopy" using the Help menu. For information about how to do this in Word 97, please see the following article in the Microsoft Knowledge Base: Q159748 How to Protect VB Code from Unauthorized Access REFERENCES"Using WordBasic," by WexTech Systems and Microsoft, pages 253-254 Additional query words: exe compile gray winword word6 word95 encrypt greyed grayed macword word7 winword2
Keywords : kbmacro wordnt kbmacroexample winword ntword macword word6 word7 word95 |
Last Reviewed: September 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |