How to Get OLE Functions from OLE Applications

---------------------------------------------------------------------
The information in this article applies to:

- 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 new 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 using
OLE Automation.

MORE INFORMATION
================

This article uses Microsoft Word version 6.0 as an example
OLE appliction. 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 OLE2VIEW.EXE, which you can get from the 
Microsoft Visual C/C++ version 1.5 (or higher) development 
kit in the \MSVC\BIN directory or by downloading SEEOLE2.EXE 
from the Microsoft Software Library.

Download SEEOLE2.EXE, a self-extracting file, from the 
Microsoft Software Library (MSL) on the following services:

 - CompuServe
      GO MSL
      Search for SEEOLE2.EXE
      Display results and download

 - Microsoft Download Service (MSDL)
      Dial (206) 936-6735 to connect to MSDL
      Download SEEOLE2.EXE

 - Internet (anonymous FTP)
      ftp ftp.microsoft.com
      Change to the \softlib\mslfiles directory
      Get SEEOLE2.EXE

After downloading SEEOLE2.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. Obtain the OLE2VIEW.EXE application by getting it from Visual C/C++
   or by downloading and running SEEOLE2.EXE. Start the OLE2VIEW.EXE
   application. Wait a few seconds while it gathers all the OLE information
   and places it in the listbox on the left side of the display.

3. Select the program with which you want to do OLE automation. In this
   case, select "Word Basic" near the bottom of the list.

4. Double-click "Word Basic" to list the interfaces in the listbox 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, please
   wait a few seconds while the Functions listbox on the left is filled
   in. The Functions listbox will display all the functions Word Basic
   supports via OLE Automation.

6. Select the function you want; in this case, select FileOpen. You can
   click in the Functions listbox to establish the focus, and then press
   F 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
   listbox.

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.

Additional reference words: 3.00 6.00 softlib
KBCategory: kbole kbprg kbinterop kbfile
KBSubcategory: IAPOLE
