Using Agents with Java, LotusScript, Formula language, Simple action, or an external manipulation with VB 2005, I’m trying to both create and access in-line images from notes documents.
We have 2 needs for this…
-
A button action that gives the user a file selection dialog that embeds the selected image as an in-line image that is displayed as an actual image when the document is opened. Our images are small, but right now, our method of image attachment is all over the place.
-
A way for another program written in VB to display the image from notes, just as it displays selected text from other fields in the document. If the image is being shown, I know its accessible. I can select it and paste it into another appliction using my mouse. I need to automate this retreival process.
My problem is that I see nothing on in-line images within the designer help. I spent a lot of time trying to get embedObject working, and when I finally did, it showed a small black and white box that said JPG. When I double click on the box, the image opens, but I need to skip the middle man.
I appreciate any help that you can lend!
Thanks,
Chris
Subject: RE: In-Line Images (Programatically insert/retreive)
It was something I found hard to believe, but its starting to look like the shocking truth. Is it true that Lotus Notes does not have a straight forward set of commands in any of its supported scripting languages that allows developers to handle images? Anything that can be done with the mouse and keyboard by the user has a command associated with it, so I know that there is a copy-paste function. I was hoping to handle this issue as you would with most programming languages, and not need to import/export documents, code in other scripts, etc for such a simple task. Is there really no such set of methods?
Subject: RE: In-Line Images (Programatically insert/retreive)
Using LotusScript, you can add an image from a file into a document that’s being edited. NotesUIDocument.Import is the method you need.
OLE doesn’t have a standard format for handling image data, and there’s no function in the regular Notes APIs to directly locate and extract the images from some rich text. It can be done with DXL, or you can use the C API to decode rich text, or the Midas API from GeniiSoft (a lot easier than the other ways, but not free and maybe not available from VB).
Subject: *For those searching later, Midas is available from VB
Subject: RE: In-Line Images (Programatically insert/retreive)
Thank you, Andre! This seems like it is exactly what I want.
However, when I try it in lotus script, I get the following error: Cannot execute the specified command. I’ve got the document in edit mode, and I’m actually using the sample code from NotesUIDocument.Import given in the help file. I’ve checked my path names, field names, etc. Any ideas?
Also, I tried the formula language verion of this:@SetField(“Body”;@Command([FileImport]; “GIF Image”; “c:\notes32\sound.gif”))
When I run that agent, I get the same error message.
I hate to pester, but what am I doing wrong?
Subject: RE: In-Line Images (Programatically insert/retreive)
You’re doing the import while the cursor is not in a rich-text field.
Subject: RE: In-Line Images (Programatically insert/retreive)
You are my new hero. Thank you.