IsExecuteOnly()

Syntax

IsExecuteOnly([Macro$])

Remarks

Returns 0 (zero) if the specified macro can be edited or –1 if the macro is execute-only. Macros that cannot be edited are sometimes referred to as encrypted. You can make a macro execute-only using MacroCopy.

Argument

Explanation

Macro$

The name of a macro. Use the following syntax:

[TemplateName:]MacroName$

If TemplateName is omitted, Word looks for the macro in the Normal template and loaded global templates. If TemplateName is specified, the template must be open in a document window, attached to an open document, or loaded as a global template; otherwise IsExecuteOnly() generates an error.

If both TemplateName and MacroName$ are omitted, the macro containing the IsExecuteOnly() instruction is assumed.


Example

This example determines whether the global macro Test is execute-only. If it isn't, Word displays the macro in the macro-editing window.


encrypted = IsExecuteOnly("NORMAL:Test")
If encrypted = 0 Then ToolsMacro .Name = "Test", .Show = 1, .Edit

See Also

IsMacro(), MacroCopy