OFF98: Programmatically Activating the Visual Basic Editor

ID: Q182811

The information in this article applies to:

SUMMARY

You can programmatically switch to the Microsoft Visual Basic Editor from a Microsoft Office 98 program. This article includes macro examples that switch to Microsoft Visual Basic for Applications.

MORE INFORMATION

Microsoft 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 the following example, the MainWindow property returns a windows object that represents the main window of the Microsoft Visual Basic environment. The SetFocus method moves the focus to the object that is returned by the MainWindow property.

   Sub ShowVBE()
     Application.VBE.MainWindow.SetFocus
   End Sub

In the following example, the ShowVisualBasicEditor property switches to Microsoft Visual Basic. This macro applies only to Microsoft Word 98.

   Sub ShowWordVBE()
      Application.ShowVisualBasicEditor = True
   End Sub

REFERENCES

For more information about the ShowVisualBasicEditor property, click the Office Assistant wile in the Microsoft Visual Basic Editor from Microsoft Word 98, type "ShowVisualBasicEditor," click Search, and then click to view "ShowVisualBasicEditor Property."

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

   ARTICLE-ID: Q179216
   TITLE     : OFF98: How to Use the Microsoft Office Installer Program

Additional query words: activate OFF98
Keywords          :  
Version           : MACINTOSH:98
Platform          : MACINTOSH
Issue type        : kbinfo

Last Reviewed: May 17, 1999