Article ID: 212536 - View products that this article applies to.
This article was previously published under Q212536
For a Microsoft Office XP version of this article, see 290140
For a Microsoft Office 97 version of this article, see 173707
For a Microsoft Office 2001 for Mac version of this article, see 274703
For a Microsoft Office 98 Macintosh Edition version of this article, see 181058
The Microsoft Knowledge Base contains a number of articles that include sample code for Visual Basic for Applications macros. Many of these macros illustrate basic concepts of programming in Visual Basic for the various Office 2000 applications. This article contains instructions on how to use the sample code to create a new macro, and how to run that macro.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements. To use the sample code from a Knowledge Base article, you must add a new Visual Basic macro (or select an existing macro). You can then copy/paste or type the sample code into this macro by using any of the following methods:
To Create a New Macro
where <application> is the Microsoft Office 2000 application that you are using. NOTE: Use the TAB key to indent text. Lines that begin with an apostrophe (') are comments and are not required to run the macro. However, you may want to type them in to make it easier to understand the macro.
To Add the Sample Code to a ModuleTo add code to a module, you must either have an existing module or create a new module. To do this, follow these steps:
where <application> is the Microsoft Office 2000 application that you are using.
To Run the Macro
Microsoft Help for each Office program contains numerous topics about working with macros. Visual Basic Help contains extensive information about writing your own code.
For additional information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/226118/EN-US/ )OFF2000: Programming Resources for Visual Basic for Applications
Article ID: 212536 - Last Review: October 11, 2006 - Revision: 4.2