Knowledge Base

MacOFF: Programmatically Activating the Visual Basic Editor

Article ID: 182811

Article Last Modified on 1/22/2007


APPLIES TO


This article was previously published under Q182811

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. 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. 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:

179216 OFF98: How to Use the Microsoft Office Installer Program


Additional query words: activate OFF98

Keywords: kbinfo KB182811