Microsoft KB Archive/170267

= WD97: WordBasic MacroCopy Command Fails =

Article ID: 170267

Article Last Modified on 9/1/2006

-

APPLIES TO


 * Microsoft Word 97 Service Pack 1

-



This article was previously published under Q170267



SYMPTOMS
When you attempt to use a WordBasic.MacroCopy command to copy a macro from any location other than a local template to any location other than a global template, the copy may fail.

The table that follows details how the WordBasic.MacroCopy, WordBasic.Organizer, and Application.OrganizerCopy commands perform in Microsoft Word 97 SR-1.

NOTE: "Global Temp" indicates any template loaded globally (that is, it is loaded by clicking Templates And Add-Ins on the Tools menu).

An error will be generated when you try to perform any of the illegal copies. The error message will change depending on the command used and the target.

Using WordBasic.MacroCopy
  Source       Target        Valid  Err  Error Message Document    Document      Yes Document    Template      Yes Document    Normal        Yes Document    Global Temp   No*    24   Bad Parameter Template    Document      Yes Template    Template      Yes Template    Normal        Yes Template    Global Temp   No*    24   Bad Parameter Normal      Document      No     24   Bad Parameter Normal      Template      No     24   Bad Parameter Normal      Normal        No     24   Bad Parameter Normal      Global Temp   No     24   Bad Parameter Global Temp Document      No     24   Bad Parameter Global Temp Template      No     24   Bad Parameter Global Temp Normal        No     24   Bad Parameter Global Temp Global Temp   No     24   Bad Parameter

Using WordBasic.Organizer
  Source       Target        Valid  Err  Error Message Document    Document      Yes Document    Template      Yes Document    Normal        Yes Document    Global Temp   No*    1844 The project item cannot be copied Template    Document      Yes Template    Template      Yes Template    Normal        Yes Template    Global Temp   No*    1844 The project item cannot be copied Normal      Document      No     102  Command failed Normal      Template      No     102  Command failed Normal      Normal        No     102  Command failed Normal      Global Temp   No     102  Command failed Global Temp Document      No     102  Command failed Global Temp Template      No     102  Command failed Global Temp Normal        No     102  Command failed Global Temp Global Temp   No     1844 The project item cannot be copied

Using Application.OrganizerCopy
  Source       Target        Valid  Err  Error Message Document    Document      Yes Document    Template      Yes Document    Normal        Yes Document    Global Temp   No*    5940 The project item cannot be copied Template    Document      Yes Template    Template      Yes Template    Normal        Yes Template    Global Temp   No*    5940 The project item cannot be copied Normal      Document      No     4198 Command failed Normal      Template      No     4198 Command failed Normal      Normal        No     4198 Command failed Normal      Global Temp   No     4198 Command failed Global Temp Document      No     4198 Command failed Global Temp Template      No     4198 Command failed Global Temp Normal        No     4198 Command failed Global Temp Global Temp   No     5940 The project item cannot be copied
 * Copying from a document or template to a global template will work if the global tempalte is open in Word for editing.



CAUSE
This functionality is by design in Microsoft Word 97 SR-1, in an effort to reduce the spread of macro viruses. This behavior is different from Microsoft Word 97. In Microsoft Word 97, the command will be executed as expected.



WORKAROUND
Instead of using the WordBasic object to copy macros from one location to another, use the Microsoft Word 97 object model.

For more information about equivalent commands in the Microsoft Word 97 object model, click the Office Assistant, type "What is WordBasic.MacroCopy?," click Search, and then click to view "Visual Basic Equivalents for WordBasic Commands."

NOTE: You must be in the Visual Basic Editor before you click the Office Assistant for help.

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Word Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:

120802 Office: How to Add/Remove a Single Office Program or Component

