Advanced PowerBuilder

HomePrevious Lesson: Cutting the OLE Control Object
Next Lesson: In-Place Editing & OLE Server Menus

Pasting an Object in the OLE Control

This function pastes into the control from the clipboard. If you have place some text and call this function, it will not paste into the control. It will paste if you are pasting into the edit control, but, not in the OLE control. To paste in the OLE control by calling this function, the content on the clipboard should be a OLE object. The syntax is:

OLEControlName.Paste()

PasteSpecial()

It presents a dialog box to select the format of the content to paste. The syntax is:

OLEControlName.PasteSpecial()

PasteLink()

Pastes the link to the content in the clipboard to the OLE control. The syntax is:

ole_control2.PasteLink()

Editing/Printing the Object in the OLE Control

Executes the verb that is supported by the server. The verbs supported by the OLE server you can find out from two sources. One from the OLE Server documentation and other is from the Registration database. For example, PaintBrush supports one verb, that is "Edit". DoVerb() takes a number as the argument. Generally argument 1 is for "Edit". For example, you placed a bitmap in the OLE control and called:

OLEControlName.DoVerb(1)

This will invoke PaintBrush in its own window. Calling this function with 1 as argument is equal to activating the OLE Server, however, there is a small difference. When you activate the server with this function, the OLE Server always activates off site, even though the server supports OLE 2.0 (For example: Word 6.0). This function is basically intended for OLE 1.0 servers.

There are few more functions related to the OLE control. These are explained in detail in the advanced section of OLE, i.e., next session. Now let us see how the menus affect when we activate the OLE Server in-place.
HomePrevious Lesson: Cutting the OLE Control Object
Next Lesson: In-Place Editing & OLE Server Menus