Hi All,
I have a Projects Db that has an Action Button to create an email to send to the Project Manager and anyone else the user selects from a Dialog Box (doc in the example below).
The Action copies some salient data into the Body of the email and then presents the draft email to the user to complete.
However, I find that the normal user Signature is now lost.
Here is the code that creates the email :
'Create a mail document
Set mailDb = session.GetDatabase(doc.maildb(0), doc.mailfile(0))
Set docMail = mailDb.CreateDocument
docMail.Form = “Memo”
docMail.Subject = doc.SubjectEmail(0)
docMail.SendTo = doc.SendTo(0)
docMail.CopyTo = doc.CopyTo(0)
docMail.BlindCopyTo = doc.BlindCopyTo(0)
docMail.Body = sComments
'sComments contains details about the project
Call ws.EditDocument(True, docMail)
If I don’t have the sComments data then the Signature is present.
Any suggestions would be greatly appreciated.
Ray.
Subject: Creating Emails from Action Button deletes Signature
Ray, your code replaces the Body field with sComments. To retain the signature, you’d need to work with NotesRichTextItem methods. You could use AppendText but your text would be after the signature. If you are using ND7, you can use some of the new methods to get to the beginning of the rich text item and insert your text. Or you could put your text in a new item and append Body to it.
Lots of options! 
Regards,
Don
Subject: RE: Creating Emails from Action Button deletes Signature
Thanks for your reply, Don.
I already tried to use RTF to create the sComments using AppendText, but as you pointed out it shows below the Signature.
If I use a different RTF field to create the sComments, then the CoreEmail script template doesn’t know about this field and it doesn’t display in the new memo.
We use Notes 6.5.4 so unless we go down the path of emulating the CoreEmail script which is what gets the Signature for the memo, then I don’t know what else to do.
Subject: RE: Creating Emails from Action Button deletes Signature
You should be able to use the NotesRichTextNavigator and related classes/methods. Look at the help for the BeginInsert method and I think you’ll find code you can use.
An alternative I was thinking about was:
-
Create the mail document so you get the RT field with the signature
-
Create a new RT item and put in your message
-
Use AppendRTItem to append the mail document item to the new RT item (which should put the signature after your message
-
Remove the RT item from the mail document and replace it with the new one you created.
Regards,
Don