hi guys,
i am trying to send emails with outlook from access.
i get an error "path or library not found"
can somebody let me know which libraries i need in order to do what i want, pls?
here is my code.
thx very much mas.
i am trying to send emails with outlook from access.
i get an error "path or library not found"
can somebody let me know which libraries i need in order to do what i want, pls?
here is my code.
Code:
Dim olApp As New Outlook.Application, olNameSpace As Outlook.NameSpace
Dim myItem As Outlook.MailItem
Set olApp = Outlook.Application
Set olNameSpace = GetNamespace("MAPI")
Set myItem = olApp.CreateItem(olMailItem)
With myItem
.To = "email address"
.Subject = vsubject
.Body = Chr(13) & Chr(13) & Chr(13) & Chr(13) & _
"Status: " & vstatus & Chr(13) & _
"Creation Date: " & Format(vpopdate, "dd/mm/yyyy") & Chr(13) & _
"POP Reason: " & vreason & Chr(13) & _
"Wine Code: " & vwine & Chr(13) & _
"Wine Desc: " & vtechdesc & Chr(13) & _
"" & vtype & "" & vhreason & Chr(13)
.Attachments.Add strFileName2
.DeleteAfterSubmit = True
.Importance = olImportanceHigh
.Send
End With
olApp.Quit
Set olApp = Nothing
Set olNameSpace = Nothing
Set myItem = Nothing
thx very much mas.