So now I am getting a Item not in collection error after changing part of the code to look at a string instead of the direct field in the table
here is the code that works and here is the code that does not work.
this works
' Attach the report and send the mail.
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)
With objmail
.BodyFormat = olFormatHTML
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)
With objmail
.BodyFormat = olFormatHTML
Dim EmailAddressstring
EmailAddressstring = rs_2("[Asu Email Addr]")
.To = EmailAddressstring
EmailAddressstring = rs_2("[Asu Email Addr]")
.To = EmailAddressstring
this does not
' Attach the report and send the mail.
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)
With objmail
.BodyFormat = olFormatHTML
Set objol = New Outlook.Application
Set objmail = objol.CreateItem(olMailItem)
With objmail
.BodyFormat = olFormatHTML
Dim EmailAddressstring
EmailAddressstring = rs_2("[Asu Email Addr]")
.To = EmailAddressstring
'.To = rs_2("[Asu Email Addr]")
Jim Wagner
On Wednesday, January 18, 2017 1:32 PM, "Steve Conklin StephenMConklin@hotmail.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:
Jim:
Your anti-virus must be up to date, and, in Outlook, the Trust Center settings have to allow programmatic access ("send emails on your behalf").
hth,
Steve Conklin
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of luvmymelody@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Wednesday, January 18, 2017 11:51 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Mailitem failed error
Sent: Wednesday, January 18, 2017 11:51 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Mailitem failed error
Hello all,
good morning everyone.
sorry for the long explanation
I am running windows 7 office 2010 and I have a procedure that works perfectly. Others who have this same set up have no issues either.
But one user has windows 10 and office 2010 and gets the error MailItem failed Run-time error Method 'To' of object '_MailItem' failed.
My laptop has windows 10 and office 2016 and I get the same error of MailItem failed
all of the references match the correct version of outlook on all machines per the office version.
I have been trying to get out of the mixed environment but nobody is listening until now. A critical report needs to be sent from the one users computer and it is not. So now everyone is blaming me.
What can I do to get the one user working?
Thank You
Jim Wagner
__._,_.___
Posted by: Jim Wagner <luvmymelody@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (3) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
.
__,_._,___
Tidak ada komentar:
Posting Komentar