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.

Set object = rtitem.EmbedObject _<br />

(EMBED_OBJECTLINK, "", _<br />

"D:\NOTES\DATA\MSWORD\WDREADME.DOC", _<br />

"MS Word 6")<br />

Display the message “Object has been linked. Save this document?” from<br />

the msg variable in a message box labeled “Save” containing a Yes and No<br />

button. This message box function returns a value when the button is<br />

clicked.<br />

answer% = Messagebox ("Object has beed linked" _<br />

& Chr(10) & "Save this document?", _<br />

boxtype, "Save ?")<br />

Save this Notes document without creating a response document.<br />

Call doc.Save (True, False)<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 Link an Object from a File button. A message is displayed.<br />

Your Notes document should look like this:<br />

Note You will receive an error message if the object file does not exist<br />

or if it is being used by another process.<br />

13. Click Yes to save the document.<br />

14. Click OK to close the document.<br />

Next, open the document.<br />

15. Display the Access OLE 2 view and open the document listed in the<br />

Linking category.<br />

Chapter 11: Using Notes as an OLE 2 Automation Client: Creating Objects 187

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

Saved successfully!

Ooh no, something went wrong!