Creating Memo in Lotus Script

I wish to create a memo using @Command([compose])This creates a signature at the base of the form as per my profile settings in the database. I then wish to populated the rich text body field with Rich text data from a profile document. I have all the elements in place;

i.e. I have the memo document

  I have the body field

  I have the rich text items to populate the body field

Does anybody know how to get them into the Body field on the open memo document using lotus script ( or anything else ! ) ?

Thanks for any help

Timothy Allen

Subject: Creating Memo in Lotus Script

is this something like you were thinking about?

Set maildoc = New NotesDocument(db)

Dim mailrt As NotesRichTextItem

if you want to format the text:

set richStyle = session.CreateRichTextStyle

richStyle.NotesFont = FONT_HELV

richStyle.FontSize = 8

richStyle.Bold = False

—creates the new document

Set maildoc = New NotesDocument(db)

maildoc.Form = “Memo”

maildoc.Principal = nameinthefromfield

maildoc.Subject = “blah blah” & doc.somefield

if you want to add some text

Set mailrt = New NotesRichTextItem(maildoc, “Body”)

Call mailrt.AppendStyle(richStyle)

Call mailrt.AppendText(“<<>>”)

Call mailrt.AddNewline(2)

Call mailrt.AppendText(“Greetings;”)

Call mailrt.AddNewline(1)

Call mailrt.AppendText(“Please click the link below to access the request.”)

 If you want some field data:

Call mailrt.AddNewline(2)

Call mailrt.AppendText("Name: ")

Call mailrt.AppendText(doc.namefield(0))

Call mailrt.AddNewline(1)

etc. etc…

If you want a doclink:

Call mailrt.AppendText("Link to something: ")

Call mailrt.AppendDocLink(doc2, “link text”)

Call mailrt.AddNewline(1)

send it

Call maildoc.Send(False, sendto)

(obviously I left off a few declarations like session and db etc…)

HTH

Subject: additional note

once a document is open on the screen, you can’t populate the rich text field (message body)

usually what everyone does is compose the doc, save and close it and run something like the code above and then re-open it in the ui. Sounds like its kinda hokey - but it all happens so quickly, the screen will flicker once quickly and the user rarely knows what just happened

Subject: reference to note and additional note

Hi Jon,

Thank you for the excellent information.

My problem is a little more complex. Do you know how to do this ? ---->

I am trying to create a memo document from an application database and populate the body field using lotus script.

( You describe that very well. )

However, I wish to create the memo document in a mail in database that we use.

The reason for this is that the mail in database inserts an HTML signature field inside the body.

That is the step that I am really struggling with.

Iff I create the memo in my application db, I can populate the body with my rich text data, but I have no html signature.

If I create the memo in my mail in database, I have the html signature but I am struggling to populate the body from my application db.

Thanks again for the info, at least it backs up my current thinking that what I am trying to do is a bit tricky

Best Regards

Timothy Allen

Subject: RE: reference to note and additional note

sorry about the late response - hope you are still reading this thread

what you ask is not any more complex than what you already have. all the code that creates the memo doc and populates the rich text field is held in memory. the doc.send happens anywhere.

you would simply need to add some additional code pice that dims the mail-in db and then creates the memo inside of it

Dim db As NotesDatabase

Dim email As NotesDocument

Dim rti As NotesRichTextItem

Set db = s.GetDatabase(“server”, “mailindb.nsf”)

'trap to make sure you have the handle to the db

If Not db.IsOpen Then

Messagebox "mailindb.nsf does not exist on server"

Exit sub

End If

Set email = New notesdocument(db) <— this will now create your email in the mailin db and the email.Wend will originate from it

HTH

Subject: RE: reference to note and additional note

Yo homie, if you still dont have an answer … here it goes:

OpenMail method

It will do what you need