Share via


Visual Basic Concepts

Using the OLE Container Control

You can link or embed any object that supports Automation (formerly called OLE Automation) into the OLE container control. Using this control, your Visual Basic application can display and manipulate data from other Windows–based applications, such as Microsoft Excel and Microsoft Word for Windows.

Figure 7.38   The OLE container control

The OLE container control is used to create a document-centered application. In such an application, the user combines data from different applications to create a single document. This type of application may be a word processor that allows the user to enter text and then embed a spreadsheet or chart.

The OLE container control allows you to add objects from other applications to your Visual Basic applications. With this control, you can:

  • Create a placeholder in your application for an object. You can create the object that appears within the OLE container control at run time, or you can change an object you have placed in the OLE container control at design time.

  • Create a linked object in your application.

  • Bind the OLE container control to a database.

  • Perform an action if the user moves, sizes, or updates the object in the OLE container control.

  • Create objects from data that was copied onto the Clipboard.

  • Display objects as icons.

  • Provide backward compatibility with an application that includes many OLE container controls (called OLE client controls in previous versions of Visual Basic).

For More Information   See "Using a Component's Visual Interface" "Programming with Components" for a detailed discussion and examples of how the OLE container control is used.