Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access & Lotus Notes Email Signatures

Status
Not open for further replies.

MikeC14081972

Programmer
May 31, 2006
137
GB
Firstly Hello as this is my first post.

I have a module in Access which generates an email in the users 'Drafts' folder in Lotus Notes and attaches any necessary documents.

The problem I'm having is with the users signature which I can not for the life of me get to appear on the outgoing email. The signature is an HTML file and their Notes set up is set to attach to all outgoing emails.

Below is the code I'm using without any db specific settings. Does anyone know how I can get the signatures to appear.

Many Thanks.

Code:
Public Function SendEmail(SendTo As String, _
                     MsgSubject As String, _
               Optional MsgBody As String, _
              Optional AutoSend As Boolean = False, _
        Optional AttachFileName As String) As Integer

Const EMBED_ATTACHMENT As Long = 1454

'Dim EMailAddress  As Variant
Dim i             As Integer
Dim Msg           As String
Dim objNotesDB    As Object 'NOTESDATABASE
Dim objNotesDoc   As Object 'NOTESDOCUMENT
Dim objNotesRTF   As Object 'NOTESRICHTEXTITEM
Dim objSession    As Object 'NotesSession

On Error GoTo Err_Handler

Set objSession = CreateObject("Notes.NotesSession")
Set objNotesDB = objSession.GetDatabase("", "")

'Open Lotus mail.
objNotesDB.OPENMAIL

If (objNotesDB.IsOpen) Then

  'Create a new mail message.
  Set objNotesDoc = objNotesDB.CreateDocument
  objNotesDoc.ReplaceItemValue "Sendto", SendTo
  objNotesDoc.ReplaceItemValue "Subject", MsgSubject

  'Add the body text.
  Set objNotesRTF = objNotesDoc.CreateRichTextItem("body")
  objNotesRTF.AppendText MsgBody
  objNotesRTF.addnewline 2

  'Attach the export file.
  If (AttachFileName <> "") Then
     objNotesRTF.EMBEDOBJECT EMBED_ATTACHMENT, "", AttachFileName,
AttachFileName
  End If

  'Gets the mail to appear in the sent items folder
  objNotesDoc.SAVEMESSAGEONSEND = True
  objNotesDoc.Save True, True

  'Send the message.
  If (AutoSend) Then
     objNotesDoc.PostedDate = Now()
     objNotesDoc.Send False
  End If

  Set objNotesRTF = Nothing
  Set objNotesDoc = Nothing

  'Return success.
  SendEmail = True

Else

  Msg = "Lotus mail could not be opened."
  MsgBox Msg, vbInformation

  'Return failure.
  SendEmail = False

End If

Set objNotesDB = Nothing
Set objSession = Nothing

Exit Function

'*****************************************

Err_Handler:

'Report the error.
MsgBox Error, vbCritical

If (Not objSession Is Nothing) Then
  Set objSession = Nothing
End If

'Return failure.
SendEmail = False

Exit Function

End Function
 
I'm not sure how to do the HTML trick. Try looking in the developerhelpdatabase. if you cant find it.. reply.
If you cant find how; you can also make a Signature yourself in VBA. Do you know how to add text to the message?

grtz Flippertje
 
I do know how to add text to the body of the message, Only problem is the signature has user names,not a problem, but also their direct email, telephone and fax numbers so would then need a table with this info which would need to be maintained.

Where is the DeveloperHelpDatabase ?

If you make something idiot proof - They'll Only make a better idiot!!!
 
try database-open
directory HELP
Lotus Domino Designer

It gives you a insight how Lotus programming is and so you can derive how to stear Lotus by VBA.

i think it will be something like this:

call objNotesDoc.sign (place before save command)

Let me know if it works for you!

grtz Flippertje
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top