ObjectAcceptFormats Property

See AlsoM8RJAX              ExampleHQ5MLS>Low

Applies To

OLE control2HQDVVU.


Specifies the list of formats an object can accept.  Not available at design time; read-only at run time.


[form.]ole.ObjectAcceptFormats (index)


ObjectAcceptFormats is a zero-based array of strings describing the valid formats that can be used in the Format property when exchanging data with an object using the Data and DataText properties.  ObjectAcceptFormatsCount specifies the number of elements in the ObjectAcceptFormats array.

The list of acceptable formats is obtained from an object.  If the OLE control does not contain an object, an error will occur when you attempt to access this property.

Data Type


See Also


Data Property2W08UX1

DataText PropertyMBTZNK

Format Property23FQAYP

ObjectAcceptFormatsCount PropertyCGOYZQ

ObjectGetFormats Property1CNFCPK

ObjectGetFormatsCount PropertyDDT1TX


Programmer's Guide:

Chapter 22, "Object Linking and Embedding (OLE)"

Example for ObjectAcceptFormats, ObjectAcceptFormatsCount, ObjectGetFormats, ObjectGetFormatsCount, ObjectVerbs, ObjectVerbsCount Properties

To run this example, place an OLE control and three list boxes on a form.  Paste the example code into the declarations section of the form and press F5 to run.  When the Insert Object dialog is displayed, select an application in the New Object list box and click OK to create an object.

Sub Form_Click ()
   Dim I                                ' Declare variable.
   ' Display the Insert Object dialog.
   Ole1.Action = 14
   ' Update the list of available verbs
   Ole1.Action = 17                     ' Fetch verbs.
   ' Clear the list boxes.
   ' Fill the Verbs list box. Since ObjectVerbs(0) is
   ' the default verb and is repeated in the ObjectVerbs()
   ' array, start the count at 1.
   For I = 1 To Ole1.ObjectVerbsCount - 1
      List1.AddItem Ole1.ObjectVerbs(I)
   Next I  

   'Fill the Accept Formats list box.
   For I = 0 To Ole1.ObjectAcceptFormatsCount - 1
      List2.AddItem Ole1.ObjectAcceptFormats(I)
   Next I

   ' Fill the Get Formats list box.
   For I = 0 To Ole1.ObjectGetFormatsCount - 1
      List3.AddItem Ole1.ObjectGetFormats(I)
   Next I
End Sub