Edit mail before send

Hi There,

Firstly, Happy New Year to all!

I have a quick question regaring sending a mail using LotusScript. i am using the following code to send a mail, BUT i would like the user to edit the mail before sending it.

The code isn’t correct, as its giving me an error saying 'It cant find the ‘memo’ form, I guess its because its not in the database…But i’m stuck as to what to put instead.

Code ::

Sub SendCreatorEmail(docCurrent As NotesDocument,strStatus)

Dim ws As New NotesUIWorkspace

Dim session As New NotesSession

Dim db As NotesDatabase

Dim docMail As NotesDocument

Dim rtitem As NotesRichTextItem

Dim uidoc As NotesUIDocument



Set db = session.CurrentDatabase

Set docMail = db.CreateDocument



docMail.Form = "Memo"

docMail.SendTo = docCurrent.CreatedBy(0)

docMail.Subject = "Your  Issue has been marked as " & strStatus

Set rtitem = docMail.CreateRichTextItem("Body")

Call rtitem.AppendText("An Issue you raised in the Issue Logging System has now been marked as " & strStatus)

Call rtitem.AddNewLine( 2 )

If strStatus = "Complete" Then

	Call rtitem.AppendText("Can you please check that the issue has been closed out to your satisfaction and if not, raise another issue referencing this one.")

Elseif strStatus = "In Progress" Then

	Call rtitem.AppendText("You will be notified once the issue has been marked as complete")

End If

Call rtitem.AddNewLine( 2 )

Call rtitem.AppendText("Click the link to view the action..............")

Call rtitem.AppendDocLink(docCurrent, "Link to action.")

'Call docMail.Send(False)

Set uidoc = ws.EditDocument(True,docMail)

End Sub

Thanks for any help.

F1H

Subject: Edit mail before send

Try this code:

Dim session As New NotesSession

Dim reg As New NotesRegistration

reg.RegistrationServer = session.ServerName

Call reg.GetUserInfo(“Roberta Person”, mailserver$, mailfile$)

Dim db As NotesDatabase

Dim docMail As NotesDocument

Dim rtitem As NotesRichTextItem

Dim uidoc As NotesUIDocument

Set db = session.GetDatabase(mailserver$, mailfile$)

Set docMail = db.CreateDocument

docMail.Form = “Memo”

Regards

Litty Joseph

Subject: Edit mail before send

There is an ‘OpenMail’ method in Lotusscript which gives you a handle to the user’s mailfile.

Add the following lines near the top of your code:

Dim MailDb As New NotesDatabase( “”, “” )

Call MailDb.OpenMail

Then change the following line:

Set docMail = db.CreateDocument

to:

Set docMail = MailDb.CreateDocument

I think the rest of the code is ok. If after the message opens in the UI and the body field is empty try adding the following line of code just before the EditDocument line:

Delete rtitem

Alex