Inserting an OLE Object By Dragging It
Inserting an OLE Object into a FRAME Entry
To insert an OLE object into a FRAME entry by dragging and dropping it:
1. Create the object using the server application. For example, if you want to embed a
Microsoft Excel chart object into your FRAME entry, use Microsoft Excel to create
the object. Or, you can select an OLE object that is embedded in another application.
2. With both SAS and the server application running, arrange the application windows
so that both the server application (with the object) and the SAS BUILD: DISPLAY
window (with the FRAME entry) are visible on the screen.
3. Select the object in the server application. Press the mouse button and drag the object
from the server application to the position in the FRAME entry where you want to
place the object. The cursor changes to a box with an arrow, indicating that the
FRAME entry is a valid place to drop the object. You do not need to draw a region in
the FRAME to insert the object. You can also use drag modifier keys, as discussed in
“Changing the Drag Action” on page 239 to control the drag and drop behavior.
When you release the mouse button ("dropping" the object), SAS inserts the object
into the FRAME, automatically creating a name and an HSERVICE entry for the
OLE object. SAS displays a representation of the object at the position that you
Dragging OLE Objects during Run Time
You can allow the dragging and dropping of OLE objects while your SAS/AF
application is running. To enable this action, you must register the OLE object type with
a valid drag and drop representation.
OLE objects must be registered with the SAS_DND_OLEOBJ representation. For more
information about registering objects for drag and drop, see the SAS/AF online
documentation for information about working with the FRAME application development
environment and for information about the Widget class.
Changing the Drag Action
By default, dragging an OLE object from another application into SAS moves the object
(unless the object is of a type that can be read and not removed). You can override this
default action by using a drag modifier; a key press that indicates you want to perform a
different drop action:
• To copy an object from the server application, hold down the Ctrl key when you drop
the object onto the target window. When you press the Ctrl key, the cursor changes to
an arrow with a box and a plus (+) sign.
• To create a link to the data in a SAS/AF FRAME entry, hold down the Ctrl and Shift
keys when you drop the object onto the BUILD window. When you press the Ctrl
and Shift keys, the cursor changes to an arrow with a box and a plus (+) sign. (This
feature might vary based on the other application.) Remember not to paste a linked
object from a temporary source, because SAS cannot locate a data source when it no
Alternatively, you can initiate a nondefault drag and drop action (if the server application
supports it). Use the right mouse button to select the object and drag and drop it into the
FRAME entry. When you release the mouse button, SAS displays a pop-up menu
Inserting an OLE Object in a FRAME Entry