claytonjgordon
Technical User
I'm trying to take an attachment saved in an Ole Object field on my main Access form and attach it to the body of an Email (using Lotus Notes).
I was write the code to send the Email but I must not be doing the Attachment part correctly because it just shows up as something like |$| instead of the attachment.
I'm useing a Module to send the Email that works as follows:
This is activated by a button on the form:
Any idea what I'm doing wrong here?
Dominus Nihil
(Master of Nothing)
I was write the code to send the Email but I must not be doing the Attachment part correctly because it just shows up as something like |$| instead of the attachment.
I'm useing a Module to send the Email that works as follows:
Code:
Option Compare Database
Option Explicit
Function SendEmail(sendto As String, copyto As String, acct As String, InvName As String, WrkType As String, Purpose As String, Key As String, Attachments As Object)'this last object isn't working
On Error GoTo Local_Err
Dim session 'As New NotesSession
Dim db 'As NotesDatabase
Dim doc 'As NotesDocument
Dim object 'As NotesEmbeddedObject
Dim Filename
Set session = CreateObject("Notes.NotesSession")
Set db = session.CURRENTDATABASE
Set doc = db.CREATEDOCUMENT()
doc.Form = "Memo"
doc.sendto = sendto
doc.copyto = copyto
doc.Subject = "WIRED: " & acct & ", " & InvName & ", " & WrkType & ", " & Purpose & ", Reference Number: " & Key
doc.Body = "Referal sent. Please check the WIRED application for more information. " & vbCrLf _
& Attachments 'this isn't working
Call doc.SEND(False)
Set doc = Nothing
Set db = Nothing
Exit Function
Local_Err:
If Err.Number = 7294 Then
MsgBox "Can't find person in your Directory!"
Else
MsgBox "Lotus Notes must be running on this workstation."
End If
Exit Function
End Function
This is activated by a button on the form:
Code:
Private Sub Submit_Click()
If IsNull(Me.Acct_) Then
MsgBox "Please enter Acct Number."
Me.Acct_.SetFocus
ElseIf IsNull(Me.InvName) Then
MsgBox "Please enter investor Name."
Me.InvName.SetFocus
ElseIf IsNull(Me.WrkType) Then
MsgBox "Please enter the work type."
Me.WrkType.SetFocus
ElseIf IsNull(Me.Purpose) Then
MsgBox "Please enter the Purpose."
Me.Purpose.SetFocus
Else
SendEmail "Clayton Gordon", "Clayton Gordon", Me.Acct_, Me.InvName, Me.WrkType, Me.Purpose, Me.Key, Me.Attachments 'last field not transfering
End If
DoCmd.Save
MsgBox "Request has been sent to Investor Relations. Your reference number is: " & Key
End Sub
Any idea what I'm doing wrong here?
Dominus Nihil
(Master of Nothing)