core

#### Accessing an OLE Object’s Automation Methods and Properties from Basic

You can access an OLE (Object Linking and Embedding) object's methods and properties from Basic to automate tasks related to the object. For example, you could change a bitmap image, populate an embedded Microsoft Excel spreadsheet object with data, or set the text in an embedded Microsoft Word document.

Suppose you add an Bitmap OLE control, and you name it "BITMAP" by setting its (Object Name) property to BITMAP, you can add program code to change the bitmap being displayed. To do this, you can access the OLE automation methods and properties for the object named BITMAP, with the following code:

AttachOLE("BITMAP_X")

You can then use the object variable BITMAP_X to set a new property value or perform an automation method call:

BITMAP_X.{property} = {value}

or

BITMAP_X.{automation method call}.

Consult your OLE's documentation for the particular OLE object you are using to know what methods and properties are available.