Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

Someone in one of our forums posted a feature request for an @Function to copy specified text data to the clipboard (OS-neutral, of course). I don't know when or if we might add such a function, but meanwhile, here's a wee bit of code that accomplishes the desired objective. The design is attached; you will need two design elements; the CopyToClipboardDialog subform and the CopyToClipboard script library (or you can just copy the function from it).

This works by creating a new NotesDocument in memory, storing the desired clipboard text into a field, then opening the document in a dialog using a subform that contains event code (in the Entering event of the field) to select all, copy and close.

The same function could be invoked from macro code, if you're in a document in edit mode, as follows:

FIELD Content := "whatever";
@DialogBox("CopyToClipboardDialog"; [AutoHorzFit]:[AutoVertFit] ; "")

If in any other context, it could be done using a formula, by writing the data into a profile document, then changing the the subform to use that profile as the field's default value.

The approach could also be extended to rich text.

Andre Guirard | 22 August 2008 10:00:46 AM ET | Caribou Coffee, Minnetonka, MN, US | Comments (0)


No Comments Found

 Add a Comment
Comment:  (No HTML - Links will be converted if prefixed http://)
Remember Me?     Cancel

Search this blog 


    About IBM Privacy Contact