Common OLE Container Control Properties

This section summarizes the properties and methods used in creating embedded and linked documents at runtime, The same properties are set by Visual Basic when the object is inserted at design time with any of the methods already described.

Class

This property identifies the type of object held by the OLE Container control. To see this, run the OLER Time application, select various types of objects registered on your system, and then click the Object Info button to view their Class property.

Display Type

This property specifies whether the object displays with the content (0) of the object or as an icon (1) of the OLE server. The related constants are:

vb OLE Display Content (0) This setting displays the object’s contents.
vb OLE Display Icon (1) This setting displays the object as an icon.

OLE Type Allowed

This property determines the type of object you can create:

• 0-Linked
• 1-Embedded
• 2-Either

The type of object is specified in the Insert Object dialog box. The related constants are:

vb OLE Linked (O) The object will be linked .
vb OLE Embedded (1) The object will be embedded .
vb OLE Either (2) The object can be linked or embedded:

OLE Drop Allowed

If this property is set to True, a user can drag-and-drop an object onto the OLE Container control at runtime. This has the same effect as copying an object onto the Clipboard and the application calling the Paste Special method on the OLE Container control.

Size Mode

This property determines how an object’s icon or data image is displayed in the OLE Container control, and its settings are as follows:

vb OLE Size Clip (0) This is the default. The object is displayed at its actual size. If the object is larger than the OLE Container control, its image is clipped by the control’s borders.
vb OLE Size Stretch (1) The object’s image is sized of the OLE Container control. The image may not maintain the original proportions of the object.
vb OLE Size Autosize (2) The OLE Container control is resized to display the entire object.
vb OLE Size Zoom (3) The object is resized to fill as much of the OLE Container control as possible while maintaining it~ original proportions.

SourceDoc

When you create a linked object, this property determines which source file to link. When you create an embedded object, this property determines which file to use as a template.

Sourceltem

This property is for linked objects only. It specifies the data to link within a file. For example, if you’re linking a range of Excel worksheet cells, the SourceItem property specifies the range of cells that are linked.

OLE Type

This property is read-only and returns the status of an object at runtime. Its value is 0 for objects, 1 for embedded objects, and 2 if no object is inserted. The related constants are:

vb OLE Linked (0) The object is linked in the OLE control.
vb OLE Embedded (1) The object is embedded in the OLE control.
vb OLE None (2) The OLE Container control is empty.

Auto Activate

This property determines whether the contents of the OLE Container will be activated by a double-click or each time the focus moves to the control. The Auto-Activate property can take the following values:

vb OLE Activate Manual (0) The object isn’t activated automatically. You use the Do Verb method to activate it.
vb OLE Activate Get Focus (1) The object is activated for editing each time the OLE container control gets the focus.
vb OLE Activate Double click (2) This is the default value. The object in the OLE Container control is activated when the user double-clicks the control.
vb OLE Activate Auto (3) The object is activated normally, either when the control receives the focus or when the user double-clicks the control.

Scroll to Top