I'm trying to send an email from Access using Outlook. I have several macros that send emails for different purposes, most using the docmd.sendobject method. This works fine althought a security message does pop up in Outlook askingthe user to confirm the action, which is not a problem.
I then have another macro that is used to send an email with a word document as an attachement. All was fine when we were using XP and 2003 but having upgraded to Win 7 and Office 2010 this no longer works. I have tried several different methods of sending this email but the jist of it is ...
Dim oLook As Object
Dim oMail As Object
Set oLook = CreateObject("Outlook.Application")
Set oMail = oLook.CreateItem(0)
.To = firstname.lastname@example.org
.Body ="Hello World"
.Subject = "hello"
All the different codes I have tried vary arround the use of creating an Outlook object. I can't use the SendObject method because it does not support attachments.
The error message that I get is...
Run-time error '287':
Application-defined or object-defined error.
I have done a lot of research on the net trying to find a solution which I have not been able to find.
One thing that does keep coming up is security within Outlook not allowing Access to send emails. Outlook doesn't even come up with the message asking the user to confirm the issue.
Has anyone else come up against this and know of a solution, whether in Access or Outlook?