sending Outlook message from Access

R

Rasta

Hi,

I have some code posted below that used to work fine sending an email
message from Access. Now I am getting the error 'error -2147467259
(80004005) operation failed'. Any ideas what may be causing this?

code:

ShippingOutFile1 = "\\cafe2000\load\shipping.out"
ShippingOutFile2 = "\\cafe2000\load\bko.out"
ShippingOutFile3 = "\\cafe2000\load\invalid.out"
ShippingOutFile4 = "\\cafe2000\load\duplicates.out"
Dim objoutlook As Object
Dim objoutlookmsg As Object
Set objoutlook = CreateObject("Outlook.application")
Application.SetOption "Show Status Bar", True
If Not bvisbible = "" Then
Application.Visible = True
End If
Set objoutlookmsg = objoutlook.CreateItem(0)
With objoutlookmsg
.To = "(e-mail address removed)"
.Attachments.Add ShippingOutFile1
.Attachments.Add ShippingOutFile2
.Attachments.Add ShippingOutFile3
.Attachments.Add ShippingOutFile4
If bvisbible = "" Then
.Send
End If
End With
Set objoutlook = Nothing
Set objoutlookmsg = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top