Access, CDO and Exchange

loybob used Ask the Experts™
I'm setting up a button on an Access form in my Access application to send an email.  I have this code working perfectly on my pc, using my Outlook 2007 and pop3 email from Verizon - it attaches the report and sends the email.


 Set objCDO = CreateObject("CDO.Message")

objCDO.From = fromEmail
objCDO.To = DsStatusData![Email]
objCDO.Subject = "Status Report from Smith Consulting"
objCDO.TextBody = "Please see the attached Status Report - It can be opened with Microsoft Word.  Please reply to this email and attach the completed form."
objCDO.AddAttachment ("F:\TABS\Status Reports\StatusReportEmail.rtf")

With objCDO.Configuration
.Fields("") = 2
.Fields("") = 1
.Fields("") = ""
.Fields("") = "password"
.Fields("") = ""

.Fields("") = 25
.Fields("") = False
End With


Set objCDO = Nothing


My user is using Exchange 2010, and on her system I'm using:

.Fields("") = ""
.Fields("") = "password"
.Fields("") = "sbs.smithllc.local"

When the code running on her system gets to


I get  "Execution of this Application has stopped due to a run-time error, the application can't contiune and will be shut down."

Is there something that needs to be configured in her Exchange server?  
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If you have POP enabled on your exchange server, grant the user access to POP3 and configure it the same as the verizon account (you might need to substitute port 25 for 587 for SMTP. by default exchange uses both ports but internal designation is 587.
You don't mention your version.  EMail can be difficult in earlier versions, but if you are on AC2010, there is a macro that uses the current users working MAPI-compliant email service.

I have attached the steps in a one line Macro that I use.


spiderwik2007:  Let me check that and see if it will work.

DoDahD:  The application uses Access 2003 runtime. I'll check, but  I don't think that would be compatible.
You are correct.   The macro is not available in 2003.  Your version issue was not clear.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial