Microsoft KB Archive/121736

{|
 * width="100%"|

FILE: OLE Automation Methods/Properties Supported by OLE App

 * }

Q121736

-

The information in this article applies to:


 * Microsoft Visual Basic Learning Edition for Windows, version 5.0
 * Microsoft Visual Basic Professional Edition for Windows, version 5.0
 * Microsoft Visual Basic Enterprise Edition for Windows, version 5.0
 * Microsoft Visual Basic Standard Edition, 32-bit, for Windows, version 4.0
 * Microsoft Visual Basic Professional Edition, 16-bit, for Windows, version 4.0
 * Microsoft Visual Basic Professional Edition, 32-bit, for Windows, version 4.0
 * Microsoft Visual Basic Enterprise Edition, 16-bit, for Windows, version 4.0
 * Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows, version 4.0
 * Microsoft Visual Basic Standard Edition for Windows, version 3.0
 * Microsoft Visual Basic Professional Edition for Windows, version 3.0
 * Microsoft Word for Windows, version 6.0

-

SUMMARY
There are a number of application products that support OLE Automation. This article explains how to find the function names and syntax to call these OLE functions from Visual Basic by using OLE Automation.

MORE INFORMATION
This article uses Microsoft Word version 6.0 as an example OLE application. However, you can also get the OLE functions from the Microsoft Word version 6.0 Developers Kit. The Developers Kit also provides a complete reference for all the parameters.

You will need to obtain OLE2VIEW.EXE. OLE2VIEW.EXE is located on the Microsoft Visual C/C++ version 1.5 Development Kit, the Microsoft Visual Basic 4.0 CD-ROM and the Microsoft Visual Basic 5.0 CD-ROM. You may also obtain OLE2VIEW by downloading OLE2V.EXE from the Microsoft Software Library.

NOTE: In order to run OLE2VIEW.EXE, you must have OLE2 installed on your system. OLE2 is installed when you install any OLE2 enabled application, for example, Microsoft Visual Basic 3.0 or any of the Microsoft Office applications (Microsoft Word 6.0, Microsoft Excel 5.0, Microsoft Access 2.0, and so forth).

The following file is available for download from the Microsoft Download Center:

"Ole2v.exe" For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:

"Q119591 How to Obtain Microsoft Support Files from Online Services" Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.

After downloading OLE2V.EXE, run it in an empty directory to extract the files it contains.

Step-by-Step Instructions

 * 1) Make sure the OLE application (Word version 6.0, in this case) has been installed correctly.
 * 2) Start the OLE2VIEW.EXE application. Wait a few seconds while it gathers all the OLE information and places it in the list box on the left side of the display.
 * 3) Select the program with which you want to do OLE automation. In this case, select "WordBasic" near the bottom of the list.
 * 4) Double-click "WordBasic" to list the interfaces in the list box on the right side of the display. You should see "IDispatch, ITypeInfo and IUnknown" listed.
 * 5) Double-click IDispatch. You should see a dialog box. Again, you need to wait a few seconds while the Functions list box on the left is filled in. The Functions list box will display all the functions WordBasic supports via OLE Automation.
 * 6) Select the function you want; in this case, select FileOpen. You can click in the Functions list box to establish the focus, and then press the F key to get to the functions that begin with the letter F.
 * 7) Click the function you want. You will see the parameters for that function displayed in the "Function Prototype" read-only edit control and a short description of the function displayed in the bottom-left list box.
 * 8) Highlight the text in the "Function Prototype" edit control and copy it to the clipboard.
 * 9) Paste the function into your Visual Basic application.