Microsoft KB Archive/181183

= WD98: How to Protect VBA Code from Unauthorized Access =

Article ID: 181183

Article Last Modified on 8/10/2007

-

APPLIES TO


 * Microsoft Word 98 for Macintosh

-



This article was previously published under Q181183





SUMMARY
In earlier versions of Word, you can use the WordBasic MacroCopy statement to convert an editable macro to an execute-only macro. You cannot edit or view an execute-only macro.

The execute-only option is used with earlier versions of Word that use WordBasic as their programming language and is used to protect macros from being modified. This execute-only feature is no longer available in Word 98 and later versions. Instead, you can use the Microsoft Visual Basic for Applications Lock Project property to protect your code from unauthorized changes or to prevent others from viewing the code.



MORE INFORMATION
Follow these steps to lock your project:


 * 1) Start the Microsoft Visual Basic Editor and open your project.
 * 2) On the Tools menu, click Project Properties, and then click the General tab.
 * 3) Set the following properties:


 * 1) * Project Name
 * 2) * Project Description
 * 3) * Help File Name
 * 4) * Project Help Context ID
 * 5) Click the Protection tab.
 * 6) Click to select the Lock Project For Viewing check box.
 * 7) Type your password in the Password and Confirm Password boxes.
 * 8) Save and close your project.

NOTE: Protection does not take effect until you save and close your project.

For more information about locking projects, click the Office Assistant while in the Visual Basic Editor,, type "lock project" (without the quotation marks), click Search, and then click to view "Protection Tab (Project Properties dialog Box)."

