Hi,
I was wondering how do I get an image that was cut and pasted into a Notes
Rich Text Field?
I have a form that displays several Rich Text field that the user can cut
and paste a bitmap from
other application, say MS Paint for example. I like to be able to get this
content to do some
processing is this possible to do using LotusScript?
Thanks,
Nick
Nick
Hi!
Well you could get the notes richtext item and then parse through
the embedded objects.
Something like
Dim indoc As NotesDocument
Dim rtitem As Variant
'Go an get the document by fair means or foul
' Lets say the RT field is BODY
Set rtitem = indoc.GetFirstItem( "Body" )
Forall o In rtitem.EmbeddedObjects
' do some stuff with the O's where are ofcourse NotesEmbeddedObjects
End Forall
Regards
Steve
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Dim rtitem As NotesRichTextItem
Set rtitem = doc.getFirstItem("signature1")
Dim object As Variant
' This is where it fails
Set object = rtitem.getEmbeddedObject(0)
Basically, what I want to do is use the richtext field as a cheap electronic
signature approval
mechanism. The user can use MS Paint to write their signature, then I would
just extract the
bitmap from the richtext field and create a MS Word report from it. If you
or anyone has an answer to this
I would really appreciate it.
Thanks,
Nick
"Stephen McDonagh" <mcdo...@freeuk.com> wrote in message
news:5bbad3f7.02041...@posting.google.com...
Sorry about the delay , but i have been out of circulation for a while and
only just got your message. Hmmmm now there is a conundrum which
kept me busy over a wet sunday afternoon.
Basically your problem is that when a user uses Paste or Paste Special
the picture is displayed on the form as an InLine Image rather than as an
OLE object. You can acchieve the same result from a file using the formula
@command([FileImport];"JPEG Image";"MySig.jpg")
This is fine but you want to get it out into a Word Doc, and there is the conundrum
for this to be possible you have to get the user to do a File/ Create / Object
which is all fine an dandy but if your users are like mine they want the ease of
Cut and Paste.
I tried a variety of code snippets to get this into a simple user button, but none
elegantly serve your puropse.
However have you thought of creating a User Profile Doc for each of the users
who will have a User Sig? This will mean your users having to save their graphic
Sigs to a file with a set name in the example below MySig.GIF and attaching it
to a user profile doc as an attachment.
1. Create a Form call it UserProfile
2. Stick an action on the Main View of your database called "Edit Sig Profile"
3. Put this code in the Action as a formula
@Command([EditProfile];"UserProfile";@UserName)
4. Create another Action Call it "Insert Graphic Sig"
5. Put this code in the Action as a LScript
Dim session As New NotesSession
Dim db As NotesDatabase
Dim docA As NotesDocument
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim rtitem As notesrichtextitem
' get the users profile doc
Set db = session.CurrentDatabase
Set docA = db.GetProfileDocument("UserProfile", session.UserName)
' Get the Current Docuemnt
Set uidoc = workspace.CurrentDocument
' Get the users sig file.
Set rtitem = docA.GetFirstItem( "SigFile" )
Set object = rtitem.GetEmbeddedObject( "MySig.gif" )
' Save this attachment
Call object.ExtractFile(object.name)
Call uidoc.GotoField( "Body" )
Call uidoc.import("GIF Image","Mysig.gif")
' Update the signers field
Call uidoc.fieldappendtext("GraphicSigners",session.username & ",")
Please note there is NO error trapping in here for Users having
those total loss of common sense moments. You will need to put
in a check that there :-
1. Is a profile doc
2. It has an attachment called MySig.gif
and if either of these is true send a rude Messagebox to the user!
To set this up your users would do the following
1. Create their graphic sigs
2. Save it as a file called MySig.Gif
3. Click on the Edit Sig Profile on the main view
4. Attach their graphics sig file in the field provided
5. Save the profile doc
6. Create or rcv the form to be signed
7. open the form in edit mode and position the cursor in the RTField at
the point they want to sign it.
8. Click the Insert Sig button.
When you are accessing the doc and want to include the sig file in Word or
whatever. you use the GraphicSigners field to retreive the Profile Docs
and get the Attachments from there..
Not Elegant but it works.
I have attached an example file on the email copy of this message
Hope it helps
Steve
"Nick Ton" <nt...@photon.com> wrote in message news:<ublrtlh...@corp.supernews.com>...