Microsoft Office 2000 Developer   

Using the WinAPI Viewer Application

See Also

The WinAPI Viewer application enables you to browse through the declares, constants, and types included in any text file or Microsoft® Jet database. After you find the procedure you want, you can copy the code to the Clipboard and paste it into your VBA application. You can add as many procedures as you want to your application.

For more information about using WinAPI in your code, see Chapter 10, "The Windows API and Other Dynamic-Link Libraries" in the Microsoft Office 2000/Visual Basic Programmer's Guide.

To view an API file

  1. From the Add-Ins menu, open the Add-In Manager, and load WinAPI Viewer.

  2. Click WinAPI Viewer from the Add-Ins menu.

  3. Open the text or database file you want to view.

    To load a text file into the viewer, click File | Load Text File, and choose the file you want to view.

    Note   If the text file you are opening is large, you may be prompted to convert the file to a database. This will make the WinAPI Viewer much faster. For more information, see Converting Text Files to Access Database Files.

    To load a database file, click File | Load Database File.

  4. Select the type of item you want to view from the API Type list: Constants, Declares, or Types.

Tip   When you open the WinAPI Viewer, you can automatically display the last file you viewed by selecting View | Load Last File.

To add procedures to your VBA code

  1. Click the procedure you want to copy in the Available Items list.

  2. Indicate the scope of the item by selecting Public or Private in the Declare Scope group.

  3. Click Add (or double-click the item). The code for the item appears in the Selected Items list.

  4. To remove an entry from the Selected Items list box, select the code, and click Remove.

  5. To remove all entries from the Selected Items list box, click Clear.

  6. When you have the desired items selected, you have two options for inserting the code into your procedure.

    -or-

    1. When you have the desired items selected, click Copy.

    2. All of the items in the Selected Items list will be copied to the Clipboard.

    3. Open your project, and go to the module in which you want to place the API information.

    4. Position the insertion point where you want to paste the declarations, constants, and/or types, and then choose Edit \ Paste.