MacroCopy Without Destination Template Specified Causes GPF

ID: Q115338


The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a


SYMPTOMS

A general protection (GP) fault occurs when you run a macro that contains a MacroCopy statement with incorrect syntax. If you precede the Macro2 (new macro) name with a colon but you do not specify the optional Template2 (destination template) argument, the GP fault occurs.

For example, this statement will result in a GP fault:


   MacroCopy "Normal:TestMacro", ":TestMacroCopy" 


CAUSE

The correct syntax when you omit the optional template name is to omit the colon.


STATUS

Microsoft has confirmed this to be a problem in Word versions 6.0 and 6.0a for Windows. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


WORKAROUND

If you don't specify a source or destination template, the Normal (or global) template is assumed. To copy the macro to the global template without specifying "Global," omit both the destination and the colon, as in the following example:


   MacroCopy "Normal:TestMacro" "TestMacroCopy" 


MORE INFORMATION

You can use the MacroCopy command to copy a macro (Macro1) from one open template (Template1) to another (Template2) or from one macro name (Macro1) to another (Macro2) within the same template. The syntax is as follows:


   MacroCopy "[Template1:]Macro1", "[Template2:]Macro2" 
The second parameter specifies the destination for the copy. In the destination parameter, both a destination template and destination macro name can be specified, separated by a colon. When the destination template is omitted, the global (Normal.dot) template is assumed.


REFERENCES

"Microsoft Word Developer's Kit," page 561

Additional query words: 6.00a gpf copying macros word6 winword macrocopy global template

Keywords :
Version : WINDOWS:6.0,6.0a
Platform : WINDOWS
Issue type :


Last Reviewed: January 7, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.