HOWTO: Run a Word 97 Macro that Requires ArgumentsLast reviewed: September 29, 1997Article ID: Q172483 |
The information in this article applies to:
SUMMARYWhen using Microsoft Word 97 as an ActiveX server, you can run a Word VBA macro by using Word's Run method. However, the Run method cannot be used with automation to run a Word macro that requires arguments. To run a Word macro that requires arguments, you can make your Word macro a method of your document or template. This article illustrates how to do this.
MORE INFORMATIONTo make a macro act as a method for your document or template, add the macro as a Public Sub to the ThisDocument object in the Visual Basic Editor for Microsoft Word. The following steps demonstrate how to create a Visual Basic application that executes a custom method of a Word document. This method expects two arguments, a string and an integer.
Steps to Create the Word Macro
Steps to Create the Visual Basic Application
Keywords : VB4ALL VB4WIN vb5all vb5howto vbwin GnrlVb kbprg Technology : kbvba Version : WINDOWS:4.0 5.0 97 |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |