Using Linked OLE Objects


A linked OLE object contains information about the object's server application and points to the data file that resides on disk, but does not contain data for the object itself. The object contains a static picture that represents the contents of the linked source.

Using the Links dialog box, you can specify to update a linked object:

  • automatically, whenever you update the source file that the object points to. (You must reload the FRAME entry before it reflects the change.)

  • manually, by choosing Update Now in the Links dialog box or by using the _UPDATE_ method in SCL.

  • manually, by pointing the object to a different source file using either the Links dialog box or the _UPDATE_ method in SCL.

Linked OLE objects that you include in a FRAME entry:

  • support open editing only (as opposed to visual editing, described in 'Editing an OLE Object within a FRAME Entry' on page 245). When you double-click on the object's representation in the FRAME, the server application is invoked in a separate window with the object's data file open .

    You can also update the data of a linked object by using the server application to open the data file the object points to.

  • must point to existing data files. If you change the location of a data file to which an object is linked, you must update the links information for the object.

If you create a linked object using OLE - Paste Special , the data source that you paste from must be permanent (that is, you must have saved it to disk). If you create a linked object from a temporary data source, SAS will be unable to locate the data to update the object when the data source no longer exists.

Updating a Linked Object with the Links Dialog Box

To update the links information with the Links dialog box (shown in Display 10.2 on page 248):

  1. Click on the object with the right mouse button. A pop-up menu appears, with the object type listed as the bottom menu item.

  2. Click on the bottom menu item. A cascading menu containing valid OLE verbs for the object appears.

  3. Click Links . The Links dialog box appears, containing link information for all of the linked objects in the FRAME entry. (If there are no linked objects in the FRAME, then the Links item is disabled.)

  4. Use the Links dialog box to change information about the object as necessary. For example, if the data file resides in a different location, you can change the source for the object link.

click to expand
Display 10.2: Links Dialog Box

An alternate way to open the Links dialog box for a linked OLE object is to use the DLGLINKS command from the command line. You can also use the _EXECUTE_ method in SCL to invoke the DLGLINKS command. For example:

 call notify('linkobj','_execute_','dlglinks'); 

Updating a Linked Object Programmatically

To change the source of a linked object programmatically with SCL, use the _UPDATE_ method to specify a new HSERVICE entry to associate with the object. The _UPDATE_ method for OLE objects accepts the name of an HSERVICE entry as a third argument. (This method overrides the Widget class _UPDATE_ method.) For the syntax of the OLE _UPDATE_ method, see '_UPDATE_' on page 595.




SAS 9.1 Companion for Windows
SAS 9.1 Companion for Windows (2 Volumes)
ISBN: 1590472004
EAN: 2147483647
Year: 2004
Pages: 187

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net