I'm using Access 97 but the method may be the same or at least very similar.
First, while in the module click on Tools, References and select, in my case
"Outlook 98 Type Library". Then...
Dim ol as Outlook.Application
Dim NewMessage as Object
Dim strPath as String
Set ol = New Outlook.application
Set NewMessage = ol.CreateItem(olMailItem)
strPath = "C:\My Documents\NameofFile.xls"
With NewMessage
.Subject = "Type the subject of your email here"
.Body = "Type message to be seen in body of email"
.Attachments.Add strPath, olByValue
.To = "Email address of person(s) to receive email"
.Send
End With
Works like a charm in Access 97.
"Mark Kovach" <(E-Mail Removed)> wrote in message
news:0c4801c35842$f2b30450$(E-Mail Removed)...
> I need to send an e-mail from a module, the problem is
> that I have to attach a file saved on the computer, not a
> report from the database.
>
> Is there a way to attach a file to an e-mail being sent
> from Access? I am using Access 2000.
>
> Thanks for your help.
>
|