VBA Created Email: Signature appears at the top

this was originally posted to the wrong forum (release 8.5, Feedback number WEBB7V8LMK). I’m hoping posting it here will receive some comments/answers…

I’m new to the IBM forums so hope this is posted to the correct place in the expected format.

Some quick background… I’m confident at Excel VBA but new to Lotus Notes 8 (used notes 5 a few years ago). I am using the code below to create an email, it works, but Notes is putting the ‘Signature’ before the message body.

Is anyone able to advise a way to test for the ‘Signature’ and either turn it off prior to creating the email or ideally apply the signature after the main body of the message.

Sub LotusNotesEmail()

Dim oWorkSpace As Object

Dim oSession As Object

Dim oDatabase As Object

Dim uiDB As Object

Dim oNotesDoc As Object

Dim oRichTextBody As Object

Dim oServer As String

Dim oMailFile As String

On Error GoTo ErrTrap

'Set-up connection to Lotus Notes and Create Email object

Set oWorkSpace = CreateObject(“Notes.NotesUIWorkspace”)

Set oSession = CreateObject(“Notes.NotesSession”)

oServer = oSession.GetEnvironmentString(“MailServer”, True)

oMailFile = oSession.GetEnvironmentString(“MailFile”, True)

Set oDatabase = oSession.GetDatabase(oServer, oMailFile)

Set uiDB = oWorkSpace.CURRENTDATABASE

Set oNotesDoc = oDatabase.CreateDocument

Set oRichTextBody = oNotesDoc.CreateRichTextItem(“Body”)

'Set-up dist list, message and attachments

oNotesDoc.SendTo = “test@test.com ’ To…”

oNotesDoc.Subject = “Test Subject” ’ The subject

oNotesDoc.Body = “This is a test” ’ Any text to be in the email

On Error Resume Next

Dim uiDoc As Object

Set uiDoc = oWorkSpace.editdocument(True, oNotesDoc)

On Error GoTo 0

ErrTrap:

'Close connection to free memory

Set oSession = Nothing

Set oDatabase = Nothing

Set oNotesDoc = Nothing

Set oWorkSpace = Nothing

End Sub

Thanks for reading.

Subject: Same problem here!

I’ve got this same problem, I hope someone here could help us out with this. I tried the suspend/restore approach for this but unfortunately that doesn’t work the SignatureOption doesn’t return anything or should I say only returns an empty string “”

sigOption = docProfile.GetItemValue(“SignatureOption”)(0)

that line returns an empty string.