Visual Basic Reference

Format Property (OLE Container Control)

See Also    Example    Applies To

Returns or sets the format when sending data to and getting data from an application that created an object. Not available at design time.

Syntax

object**.Format** [ = format]

The Format property syntax has these parts:

Part Description
Object An object expression that evaluates to an object in the Applies To list.
Format A string expression specifying the format used with the Data and DataText properties.

Remarks

Use the ObjectAcceptFormats, ObjectAcceptFormatsCount, ObjectGetFormats, and ObjectGetFormatsCount properties to get a list of the acceptable data formats for a specific class of object.

Many applications that provide objects support only one or two formats. For example, Microsoft Draw accepts only the CF_METAFILEPICT format. Although CF_METAFILEPICT resembles the intrinsic constant vbCFMetafile (numeric value 3) defined in the Visual Basic (VB) object library in the Object Browser, it's actually a string literal and is assigned as:

Ole1.Format = "CF_METAFILEPICT"

In many cases, the list of formats an object can accept (ObjectAcceptFormats) is different from the list of formats an object can provide (ObjectGetFormats).