MacroCopy

Syntax

MacroCopy [Template1:]Macro1$, [Template2:]Macro2$ [ExecuteOnly]

Remarks

Copies a macro from one open template to another. MacroCopy cannot replace an open macro. A template is open if it is attached to an open document, open in a document window, or loaded as a global template. If you make the new macro execute-only, it cannot be edited.

Argument

Explanation

Template1, Template2

The open template containing the macro you want to copy and the open template to which you want to copy the macro, respectively. In Windows, if you do not include the filename extension in the template name, .DOT is assumed.

Include paths if the templates are not in the folder specified by User Templates in the File Types box on the File Locations tab in the Options dialog box (Tools menu).

Macro1$, Macro2$

The name of the macro to copy and the name of the new macro, respectively.

ExecuteOnly

If nonzero, makes the destination macro execute-only. Note that this action cannot be reversed. It is a good idea to make a copy of a macro before making the original execute-only.


If you don't specify a source or destination template, the Normal template is assumed. You can use the syntax Global:MacroName$ to specify the Normal template as the source or destination in a MacroCopy instruction. For example:


MacroCopy "MyTemp:DelStylesTest", "Global:DelStyles"

Though not required, including "Global:" can make MacroCopy instructions affecting the Normal template easier to read.

Example

This example copies the MyTest macro from the MYTEMP template to the Normal template. The new macro is given the name MyFinal.


MacroCopy "MYTEMP:MyTest", "Global:MyFinal"

See Also

IsExecuteOnly()