See Also Example
Applies To
OLE control.
Description
Specifies the list of formats an object can accept. Not available at design time; read-only at run time.
Usage
[form.]ole.ObjectAcceptFormats (index)
Remarks
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
String
Help:
Data Property
DataText Property
Format Property
ObjectAcceptFormatsCount Property
ObjectGetFormats Property
ObjectGetFormatsCount Property
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.
List1.Clear
List2.Clear
List3.Clear
' 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