G
Guest
Hi,
I want to be able to email an MS Access Table, Query, or Report using VBA
but can't seem to figure out how to do it. All the examples I've seen have
been for emailing a file on the network - I've tested these examples and they
work fine, but I don't want to have to output my Access table/query/report to
the network in order to email it.
Here's the code - the SendEmails function pulls the email address (Eadds)
and Report Name (RptNm) from a table):
Function SendEmails(Eadds As String, RptNm As String)
Dim oOLApp As Outlook.Application
Dim oOLDoc As Outlook.MailItem
Set oOLApp = New Outlook.Application
Set oOLDoc = oOLApp.CreateItem(olMailItem)
With oOLDoc
.To = Eadds
.Subject = "test " & RptNm
.Body = "Test2"
.Attachments.Add ("\\Ihe-apps1\Data\Servicing\ELI\IResults\?")
.Display
End With
End Function
The question mark denotes where I'm getting stuck.
Any help would be much appreciated.
Manuel
I want to be able to email an MS Access Table, Query, or Report using VBA
but can't seem to figure out how to do it. All the examples I've seen have
been for emailing a file on the network - I've tested these examples and they
work fine, but I don't want to have to output my Access table/query/report to
the network in order to email it.
Here's the code - the SendEmails function pulls the email address (Eadds)
and Report Name (RptNm) from a table):
Function SendEmails(Eadds As String, RptNm As String)
Dim oOLApp As Outlook.Application
Dim oOLDoc As Outlook.MailItem
Set oOLApp = New Outlook.Application
Set oOLDoc = oOLApp.CreateItem(olMailItem)
With oOLDoc
.To = Eadds
.Subject = "test " & RptNm
.Body = "Test2"
.Attachments.Add ("\\Ihe-apps1\Data\Servicing\ELI\IResults\?")
.Display
End With
End Function
The question mark denotes where I'm getting stuck.
Any help would be much appreciated.
Manuel