Visual Basic Concepts

Converting Existing Applications into ActiveX Documents

You may have several existing applications that are candidates for conversion into ActiveX documents. If so, you can use the ActiveX Document Migration Wizard to ease the transition.

Note   The OLE Container control and embedded objects (for example, Microsoft Word or Microsoft Excel documents) cannot be placed on an ActiveX document, and will be removed.

To use the ActiveX Document Migration Wizard

  1. Open the project you wish to convert.

  2. On the Add-Ins menu, click Add-In Manager.

  3. Highlight VB ActiveX Document Migration Wizard, click the desired behaviors in Load Behavior, and then click OK.

  4. On the Add-Ins menu, click ActiveX Document Migration Wizard.

  5. Follow the directions until the Wizard has finished its task.

What the Wizard Does

The Wizard performs the following tasks

Note   The Form object's Load event doesn't have a direct counterpart in the UserDocument. You place Load event procedures in the Show event handler, but you should be aware that the Show event gets called every time the user navigates to the ActiveX document (in a Web browser). To prevent Load event procedures from running every time the Show event occurs, use a module-level variable as a flag — if the flag has been set, don't run the procedures. Code for this technique is shown in "Determining the ActiveX Document's Container Programmatically" in this chapter.