Paul McFedries' Web Home


VBA Unleashed cover Visual Basic for Applications Unleashed

Chapter 21—Web Page Programming: ActiveX and VBScript

Go To VBA Unleashed Home Page Go To Top Go To Prev Go To Next

Inserting ActiveX Controls

When you load the ActiveX Control Pad, you end up in a window like the one shown in Figure 21.1. As you can see, the Control Pad presents you with a new Web page that contains the basic HTML tags. You can use this file as a starting point if you want to work on a new page, or you can open an existing HTML document (by selecting File | Open). Either way, you add to the file by using any of the following techniques:

  • Type text and HTML tags directly in the document window.
  • Insert an ActiveX object.
  • Insert an HTML layout.
Screen shot of the ActiveX Control Pad window
Figure 21.1.
The ActiveX Control Pad window.

I'll show you how to work with HTML layout files later in this chapter. The rest of this section shows you how to insert ActiveX controls.

To insert an ActiveX control, position the cursor where you want the control to appear and then select Edit | Insert ActiveX Control. In the Insert ActiveX Control dialog box, shown in Figure 21.2, use the Control Type list to highlight the control you want to work with, and then click OK.

Screen shot of the Insert ActiveX Control dialog box
Figure 21.2.
Use this dialog box to choose the ActiveX control you want to insert.

When you insert the object, the ActiveX Control Editor appears and the object's properties sheet is displayed, as shown in Figure 21.3. Each property shown corresponds to a <PARAM> tag for the object. All you have to do, however, is click a property and then enter the value you want in the text box near the top of the sheet. To apply the property, either click the Apply button or press Enter. When you're done, close the properties sheet to return to the ActiveX Control Editor window. From there, you can size the control to suit your needs. If you need to return to the properties sheet, double-click the control.

Screen shot of the ActiveX Control Editor
Figure 21.3.
The ActiveX Control Editor and properties sheet.

When all that's done, close the Editor window. The ActiveX Control Pad will insert the appropriate <OBJECT> and <PARAM> tags into the HTML file, as shown in Figure 21.4. If you need to make changes to the control, you have two choices:

  • Move the cursor between the <OBJECT> and </OBJECT> tags and select Edit | Edit ActiveX Control.
  • Click the Edit ActiveX Control button that appears to the left of the object's tags (see Figure 21.4).
Screen shot of the ActiveX Control Pad
Figure 21.4.
The ActiveX Control Pad sets up the correct <OBJECT> and <PARAM> tags automatically.

Go To VBA Unleashed Home Page Go To Top Go To Prev Go To Next


Copyright © 1995-2008 Paul McFedries and Logophilia Limited