|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tools for working with Notes Doclinks (continued)
At line 14 we display a view in a Picklist dialog. The user selects the document that will be the target of the doclink, and in line 18 we get a handle to that document. If we could then just insert a doclink at this point using this document as the source, all would be dandy, but there is no way of creating a foreground doclink; it has to be pasted in. This is where the complication starts.
In line 24 we create a new, temporary, document in the database, and add the form field value "tdoclink". I've added this form to the database as well; it just has a single RichText field at the top of the form, called "body". Now when I say at the top of the document, I mean just that -- the form contains absolutely nothing else but this field -- no newlines or spaces before or after the field. I also set the form to be unavailable for both Create menu and Search by Form, so that the form is completely invisible to end-users.
Lines 26 to 29 is where we actually place a doclink in that body field in this new document, and save the document. Now, in lines 31 and 32, we open that document in read mode, in a NotesUIDocument. What is surfaced in that UIDocument is the doclink. Don't worry, the document won't display on the screen, because the screen is only refreshed when the script ends. We'll have closed the UIDocument by then.
Line 34, the NotesUIDocument.SelectAll, selects all that's displayed - and that is why the tdoclink form must not contain anything else other than the "body" field - if it does, it gets selected along with the doclink that's in the "body" field. Having selected it, we copy it to the clipboard, close and throw away the temporary document, and paste the doclink - line 39 - at the current insertion point.
Whew!
Mick Moignard has been working and traveling with Lotus Notes since Release 2.0 in 1991. Mick is a DominoPower Senior Technical Editor and a Principal CLP with Unipart Expert Practices, a Lotus Advanced Partner in the UK. If you want to discuss anything to do with this article, or indeed anything else to do with Notes and Domino, contact Mick at Mick_Moignard@unipart.co.uk. Unipart Expert Practices will also happily discuss any opportunities you may have with any Notes and Domino application development or infrastructure projects you need help with. Unipart Expert Practices can be found at http://www.unipartep.com.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- Advertisement --
Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.
Register by April 10 to save $200. |
|
|
|
|
|
|
|
|
|
|