FILE: OLE Automation Methods/Properties Supported by OLE App

Last reviewed: September 29, 1997
Article ID: Q121736
The information in this article applies to:
  • Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, version 5.0
  • Microsoft Visual Basic Standard, Professional, and Enterprise Editions, 16-bit and 32-bit, for Windows, version 4.0
  • Standard and Professional Editions of Microsoft Visual Basic 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 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.
Keywords          : IAPOLE VB4ALL VB4WIN vb5all VBKBAutomation vbwin GnrlVb kbinterop kbprg kbsample kbfile
Technology        : kbole kbvba
Version           : WINDOWS:3.0 4.0 5.0 6.0
Platform          : WINDOWS
Solution Type     : kbfile


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.