18.01.2013 Views

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

LotusScript for Visual Basic Programmers - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The object’s application is launched according to the object type in the<br />

object rich text item.<br />

Set handle = object.Activate (True)<br />

Next, compose a document using this <strong>for</strong>m.<br />

11. Choose Create - OLE 2 Document from the menu bar.<br />

12. Click the Edit Embedded or Linked Object button.<br />

When you use this <strong>LotusScript</strong> code to edit an embedded object, OLE 2<br />

launches the object’s application and displays the object’s data in this<br />

application <strong>for</strong> a while. To display the data permanently and to manipulate<br />

the object data in its native application, you need to modify the above<br />

<strong>LotusScript</strong> code by adding some native <strong>LotusScript</strong> function <strong>for</strong> the object.<br />

For example, if you edit a Word Pro document, you can add some Word<br />

Pro native function in your <strong>LotusScript</strong> code to edit or manipulate the<br />

Word Pro object’s data. For more in<strong>for</strong>mation on the functions that can be<br />

accessed by OLE 2 and Notes, refer to the product manuals provided with<br />

the object’s application.<br />

Deleting an Embedded or a Linked Object Using <strong>LotusScript</strong><br />

You can delete an embedded or a linked object in a Notes document using<br />

<strong>LotusScript</strong>. In the following example you will delete an embedded or<br />

linked object based on the object name that you enter.<br />

Follow these steps to create <strong>LotusScript</strong> code <strong>for</strong> deleting an embedded or a<br />

linked object in a Notes document:<br />

1. Open the OLE 2 Notes database. The view window displays.<br />

2. On the navigator pane, select Design, then Forms, and open the OLE 2<br />

Document <strong>for</strong>m. The Form Design window displays.<br />

3. Move to the end of the <strong>for</strong>m and click the cursor under the Edit<br />

Embedded or Linked Object button.<br />

4. Choose Create - Hotspot - Button from the menu bar and then type<br />

Delete Object in the Button label: box.<br />

5. Next to Properties <strong>for</strong>: Button, drop down the list of available choices<br />

and select Text. Notice how the new button on the <strong>for</strong>m now displays<br />

its title.<br />

Tip With the button properties still displayed, you can also highlight<br />

the new button by dragging the cursor from left to right. This<br />

automatically changes the button properties to text properties.<br />

196 <strong>LotusScript</strong> <strong>for</strong> <strong>Visual</strong> <strong>Basic</strong> <strong>Programmers</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!