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

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

Private Sub Form_Click ()
   Dim I   ' Declare variable.
   ' Display the Insert Object dialog box.
   Ole1.InsertObjDlg
   ' Update the list of available verbs.
   Ole1.FetchVerbs   ' Fetch verbs.
   ' Clear the list boxes.
   List1.Clear
   List2.Clear
   List3.Clear
   ' Fill the verbs list box. Because 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