Home > Lotus Notes Solution, Lotus Notes Tutorial, LotusScript, Notes Designer > Lotusscript: How to insert Body Above Signature in Memo

Lotusscript: How to insert Body Above Signature in Memo

I got Lotusscript library functions and sample code that I found useful and used in all this project. Some simple and some are not. Or very little research and work before I came to work. In this article, as examples. The signing off emails from Lotusscript.

Problems.
When a record from the backend Lotusscript then displays the user frontend / class UI, the user’s email signature. (If enabled) will be inserted at the top of the document as text to lower expectations on behalf of North.

Solution:.
Disable signature and open. Work as shown in the following sample code.

Limitations.
This is just an example of. Disable the user’s email signature. To insert the end. Content of your email. (In this example “Hello World!”), You can edit the examples and read the signature of Lotus notes doc Profile then insert

Pre – requisites:.
This has been tested in Lotus Notes 6.5.3 but should work in earlier versions, such as R5 and later ND7 release.
Write a comment if you have This verification work. (Or work) in other models.

Below is a sample code.
1) Create a school record backend Lotusscript,.
2) disable the user’s email signature.
3) Records show the user frontend Lotusscript learning and
4) re-enable the user’s email signature.

Please note that. NotesRichTextItem. Improvement in this example in ND6.

' ------------------------------------------------

Dim workspace As New NotesUIWorkspace
Dim dbMail As NotesDatabase
Dim docMail As NotesDocument
Dim rtitem As NotesRichTextItem

Dim docProfile As NotesDocument
Dim strProfileEnableSignature As String

‘Open users mail database
Set dbMail = New NotesDatabase( “”, “” )
Call dbMail.OpenMail
If Not dbMail.IsOpen Then
Call Messagebox(“Could not open mail database.”, 48, “Error”)
Exit Sub
End If

‘Create new memo from back end
Set docMail = dbMail.CreateDocument
docMail.Form = “Memo”
docMail.Subject = “Hello”
Set rtitem = New NotesRichTextItem( docMail, “Body” )
Call rtitem.AppendText(“Hello world!”)
Call rtitem.AddNewline(1)
Call rtitem.Update ‘Update method is new in ND6

‘Disable signature in users mail profile
Set docProfile = dbMail.GetProfileDocument(“CalendarProfile”)
strProfileEnableSignature = docProfile.EnableSignature(0)
If strProfileEnableSignature = “1″ Then
docProfile.EnableSignature = “”
Call docProfile.Save(True,False)
End If

‘Show memo to UI/front end
Set uidoc = workspace.EditDocument(True, docMail,,,True,True)

‘Re-enable signature in users mail profile
If strProfileEnableSignature = “1″ Then
docProfile.EnableSignature = “1″
Call docProfile.Save(True,False)
End If

Viewed 13576 times by 4290 viewers

  1. Pavel
    November 3rd, 2010 at 22:10 | #1

    Thanks for the solution!

    Looks like code below allows to bypass AUTOSIGNATURE without touching the profile
    docMail.~$AutoSaveRecovered=”1″

  1. No trackbacks yet.