Sorry dude,
It won't let me attach it for some reason so I'll give you the code.
Mailer1 module
Public Function SendNotesMail(subject As String, Attachment As String, BodyText As String, SaveIt As Boolean, RtnRec As String)
Dim y As Integer, z As String
Dim X
Dim recip(50) As Variant
Dim Maildb As Object 'The mail database
Dim UserName As String 'The current users notes name
Dim MailDbName As String 'The current users notes mail database name
Dim MailDoc As Object 'The mail document itself
Dim AttachME As Object 'The attachment richtextfile object
Dim Session As Object 'The notes session
Dim EmbedObj As Object 'The embedded object (Attachment)
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set Maildb = Session.GETDATABASE("", MailDbName)
If Maildb.ISOPEN = True Then
Else
Maildb.OPENMAIL
End If
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
MailDoc.sendto = "lee keenan/jpmchase"
MailDoc.CopyTo = recip
MailDoc.subject = subject
MailDoc.body = BodyText
MailDoc.SAVEMESSAGEONSEND = SaveIt
If Attachment > "" Then
Set AttachME = MailDoc.CREATERICHTEXTITEM(Attachment)
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
MailDoc.CREATERICHTEXTITEM ("Attachment")
End If
MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
MailDoc.ReturnReceipt = RtnRec 'sets the return receipt on or off (0 or 1) value 0 is off.
MailDoc.SEND 0, primeUser
primeUser = ""
'Clean Up
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing
End Function
Button1
Private Sub Command79_Click()
On Error GoTo Err_Command79_Click
SendNotesMail "Query", "", "Your query is under investigation", False, "0"
Exit_Command79_Click:
Exit Sub
Err_Command79_Click:
MsgBox Err.Description
Resume Exit_Command79_Click
End Sub
Combo box
Private Sub Combo83_AfterUpdate()
End Sub
At the moment it mails Lee Keenan/jpmchase (internal email) fine because of the MailDoc.sendto = "lee keenan/jpmchase" command in the module.
I need the data selected in the combo box (linked to a table) to determine this.
Cheers mate