Attach Print Screen

Hi All

Is it possible to attach a print screen into a rich text field but have it show as a file instead of the actual print screen ( Convert image to file ??? )

Currently users are saving the file as a BMP and then attaching it to the field in the form , this is time consuming so i was wondering if the above is possible in some way.

Thanks

Ray

Subject: Attach Print Screen

Yes…You can directly paste into RichText Field.

say

  1. press PrintScreen.

  2. Go to RichText field where u want to put that screen.

  3. now press Ctrl+V button or from Edit menu → select paste.

This will put your screen as it is in RichText Field.

Please try, n let me know if you need more info.

Subject: RE: Attach Print Screen

Hi Prashant

Thanks for the reply but pasting the print screen isn’t a problem , it’s how it’s pasted.

i’m looking to for the screenshots to paste in as file and not an image.

So that when the user presses ctril+v the print screen attaches as a file.

Not sure if this can be done in Notes but i’ve seen it as an option in other systems.

Ray

Subject: RE: Attach Print Screen

Hi Ray,

I am not sure wht you are saying… little bit confusing…

you want, when user presses Ctrl+V after printscreen, it should attached in RTfield as image not as attachment?

if yes… then this approach is working perfectly fine at my workstation.

Subject: RE: Attach Print Screen

not sure if i can explain it any other way.

When the user ctrl + c or " Print Screen " , and then ctrl + V into the RTF , i want the printscreen to paste in as an attachment and not an image.

My problem is the images are far too big and take up most of the room on the form , and in some case push fields to one side.

Subject: RE: Attach Print Screen

the answer to your question is, NO. By the way, your first explanation was fine.

Subject: RE: Attach Print Screen

The contents of the clipboard are not in a file format. You would need to have a program process the clipboard contents and convert the contents to a file. Notes is not a graphic editor program, so it’s not well suited to this task. There’s no UI in Notes where you could even manually, take a graphic off the clipboard and (let’s say) save it as a GIF file.

If you have a different program installed on users’ workstations that can do this and that provides an OLE API (I’m assuming Windows workstations here), then you could use OLE automation to launch that program (see CreateObject in help), and use that API to tell it to create a new image from the clipboard and save the result to a path that you specify. Then you could code to get the file into your document, as described here: Front-end file attachments in LotusScript

There is another way, but you will need a machete and a native guide. Say you want to implement “paste image attachment” as an action button, in an OS-independent way. You create a form which you will open in a dialog. The form contains a rich text field that has Entering event code in it, to do a paste and then close the dialog. The Queryclose code of the dialog uses NotesUIDocument.Refresh(true) to make the pasted image available to the back end. Use the NotesDocument as input to a DXL parser. Use a NotesMIMEEntity to convert the image part of the DXL into a GIF file, which you write to disk. Store the filepath into an INI variable. Allow the dialog to close. That was all the Queryclose event still.

Now, in the action formula, you launch the dialog, then consult the INI variable to see whether the paste worked (it might not have been an image on the clipboard). If the INI contains a filepath, use the @Command to create the attachment.

I did warn you. But the nice thing about this is, once you’ve done it once, it’s completely reusable. In fact, you could even implement it as a separate NSF, with a toolbar button to activate it, so that you could use it in any application.

Subject: RE: Attach Print Screen

I’ve created the tool to convert clipboard image into a GIF, and blogged about it. It should be visible to you by morning (see URL below), and you can download it.

  • Andre Guirard, IBM/Lotus Development

Useful blog: Best Practice Makes Perfect

For faster answers, be C R I S P Y