LotusScript accesses clipboard to view copied Notes documents

You can access and examine clipboard data for copied Lotus Notes documents/design pieces to determine the nature of the content. What's more, you can match the Notes documents on the clipboard against existing documents, since they still have universal IDs intact.

Related resources from SearchDomino.com:
Alternate version of @Command forwards subform via LotusScript

Dynamically update Lotus Notes rich-text fields using LotusScript

Top 10 LotusScript tips

The ability to check clipboard content can be useful when using queryPaste events to determine the nature of the content that's being pasted into the database. You can also use it as a temporary "dumping ground" for problem documents that you want to analyze using test agents -- without touching the original documents or modifying the test agent code.

Lotus Notes stores cut or copied documents and design pieces to a temporary database. To retrieve these documents, access a local temporary file called "~clipbrd.ncf" as a NotesDatabase object, and use this database's AllDocuments property. Here are two LotusScript code snippets, the first of which performs a copy/update to documents in the target database that have the same universal IDs.

LotusScript to access and examine clipboard data
(Click on code for enlarged view and script download.)

The second code snippet opens the clipboard in the Lotus Notes user interface.

LotusScript to access and examine clipboard data
(Click on code for enlarged view and script download.)

Note: You must add a form to the design -- or have documents with stored forms -- to fully open the documents. This exploits another undocumented feature, the UniversalID property of NotesView.

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member Rodney Rear. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

This was first published in November 2008

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.