The information in this article applies to:
SYMPTOMSIn Word 6.x, when you run a macro that you created in Word 2.x, errors may occur or Call statements may run a same-name macro from the wrong template. CAUSEWord 6.x follows a different set of rules than Word 2.x does to determine which template macro to run when two macros have the same name: Word 2.x runs the macro from the template attached to the document where the insertion point is currently located, and Word 6.x runs the macro from the template from which you launched the macro. This difference in resolving macro naming conflicts may cause errors when you run Word 2.x macros in Word 6.x. STATUSMicrosoft has confirmed this to be a problem in the versions of Microsoft Word listed at the beginning of this article. This problem was corrected in later versions of Microsoft Word with the addition of a new WordBasic command, WW2CallingConvention(). In Word 6.0a and later, you can use WW2CallingConvention() to toggle between the Word 2.x and Word 6.x methods for resolving macro name conflicts. Refer to the "More Information" section below for details about WW2CallingConvention(). MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/supportnet/refguide/In both Word versions 2.x and 6.x, you can call one macro from another using the ToolsMacro statement or the following Call syntax:
In Word 2.x, if there are two macros with the same name, Word runs the
macro from the active template (that is, the template where the insertion
point is located), whereas Word 6.x runs the macro from the template where
the calling macro resides.
WW2CallingConvention Statement Syntax
The WW2CallingConvention statement toggles between the Word 6.x and Word
2.x naming-conflict resolution method.
NOTE: The default argument is 1. In other words, if you do not include
an argument, WW2CallingConvention switches to Word 2.x behavior.
WW2CallingConvention() Function Syntax
Demonstration: Difference Between Word 2.x and Word 6.x ConventionsUse the following procedure to demonstrate the difference between the two WW2CallingConvention settings:
http://www.microsoft.com/worldwide/default.htm Additional query words: hierarchy wrong precedence takes first second instead context ip custsales
Keywords : kbmacro wordnt kbmacroexample macword word6 |
Last Reviewed: December 23, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |