MacroCopy Without Destination Template Specified Causes GPF

Last reviewed: August 4, 1997
Article ID: Q115338
6.00 6.00a WINDOWS kbusage kbmacro

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

Kbcategory: kbusage kbmacro KBSubcategory:


Additional reference words: 6.00 6.00a gpf copying macros word6
winword macrocopy global template
Version : 6.00 6.00a
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 4, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.