FILE: OLE Automation Methods/Properties Supported by OLE App

ID: Q121736

The information in this article applies to:

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 Software Library:

 ~ Ole2v.exe (size: 885799 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from
               Online Services

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.

REFERENCES

For additional information, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q122244
   TITLE     : SAMPLE: Ole2View 1.33 Update Available in Software Library
Keywords          : kbfile kbinterop kbAutomation kbVBp300 kbVBp400 kbVBp500 kbWord 
Version           : WINDOWS:3.0,4.0,5.0,6.0
Platform          : WINDOWS

Last Reviewed: January 6, 1999