Hi I have a problem with wanting to make my code attach a file.
Here is my code to send an email with ms access 97.
I need help with adding code that will allow me to attach files to my message with a string address ie "strAttachmentAddress". Can somebody please help?
My code:
Function SendLotusEmail()
On Error GoTo Ett_Trap
Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Dim ToName As String
Dim CCName As String
Dim BCCName As String
Dim Subject As String
Dim BodyText As String
ToName = "teabags@tea.com"
CCName = ""
BCCName = ""
Subject = "This is a test"
BodyText = "You are tea"
Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.getdatabase("", "")
Call notesdb.openmail
Set notesdoc = notesdb.createdocument
Call notesdoc.replaceitemvalue("Sendto", ToName)
Call notesdoc.replaceitemvalue("CopyTo", CCName)
Call notesdoc.replaceitemvalue("BlindCopyTo", BCCName)
Call notesdoc.replaceitemvalue("Subject", Subject)
Call notesdoc.replaceitemvalue("Body", BodyText)
Call notesdoc.Send(False)
Call notesdoc.Save(True, False)
Set notessession = Nothing
MsgBox "Email sent"
Ett_Trap_Exit:
Exit Function
Ett_Trap:
MsgBox Err.Description
Resume Ett_Trap_Exit
End Function
Here is my code to send an email with ms access 97.
I need help with adding code that will allow me to attach files to my message with a string address ie "strAttachmentAddress". Can somebody please help?
My code:
Function SendLotusEmail()
On Error GoTo Ett_Trap
Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object
Dim ToName As String
Dim CCName As String
Dim BCCName As String
Dim Subject As String
Dim BodyText As String
ToName = "teabags@tea.com"
CCName = ""
BCCName = ""
Subject = "This is a test"
BodyText = "You are tea"
Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.getdatabase("", "")
Call notesdb.openmail
Set notesdoc = notesdb.createdocument
Call notesdoc.replaceitemvalue("Sendto", ToName)
Call notesdoc.replaceitemvalue("CopyTo", CCName)
Call notesdoc.replaceitemvalue("BlindCopyTo", BCCName)
Call notesdoc.replaceitemvalue("Subject", Subject)
Call notesdoc.replaceitemvalue("Body", BodyText)
Call notesdoc.Send(False)
Call notesdoc.Save(True, False)
Set notessession = Nothing
MsgBox "Email sent"
Ett_Trap_Exit:
Exit Function
Ett_Trap:
MsgBox Err.Description
Resume Ett_Trap_Exit
End Function