library not found

adaniele

Registered User.
Local time
Tomorrow, 03:34
Joined
Jul 18, 2005
Messages
176
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.
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.
 
In the VBE Code Editor Window, click on Tools, then References.... You will need a reference to Microsoft Outlook
 
kernelk, thx very much 4 your comment.
the outlook library is there.
thx, max.
 
solved

i removed the library and put it back.
it worked this time.
thx everybody.
 

Users who are viewing this thread

Back
Top Bottom