0

Is there a way to determine what kind of data currently is in the clipboard? I'm trying to check this on HCL Notes' QueryPaste-event, which occurs when a user is about to paste "something" into a view. It would be awesome if I could check whether the clipboard's content is a file - if so, I'd like to write this file to disc an process its content.

Any ideas about this?

Thanks, Buzzy

  • A file is not a [standard clipboard format](https://learn.microsoft.com/en-us/windows/win32/dataxchg/standard-clipboard-formats). Files live in the clipboard in the shape of shell objects. You'll need COM to get to the internals. – IInspectable Oct 01 '20 at 08:34
  • 1
    I am not even sure, if QueryPaste reacts to a paste that does NOT contain Notesdocuments... If you want to get the documents that have been copied, then you can look at ~clipbrd.ncf: It is a Notes Database that contains the copied Notes Documents and can be inspected with default LotusScript commands... – Tode Oct 01 '20 at 10:39
  • As Torsten said, QueryPaste in a view probably doesn't respond to pasting anything which isn't NotesDocuments. Also if someone copies NotesDocuments, they don't go into the Windows clipboard, but instead go into the local ~clipbrd.ncf database. My answer to another SO question provides some relevant code if you want to check documents in QueryPaste: https://stackoverflow.com/questions/62147353/retrieving-notesdocumentcollection-during-querypaste – Scott Leis Oct 02 '20 at 01:27

1 Answers1

1

It should be possible for LotusScript to call Windows platform APIs to query the Windows clipboard, but doing what you want from a view's QueryPaste event isn't possible.

I've done some testing, and found that if a user hasn't copied any Notes documents in the current session (i.e. between starting Notes and quitting Notes), then a view's QueryPaste event doesn't run when trying to paste anything. QueryPaste only runs when pasting Notes documents.

Scott Leis
  • 2,810
  • 6
  • 28
  • 42