Solved

Can't send email generated from other office program without unspecific error message "The operation failed".

Posted on 2014-10-22
8
232 Views
Last Modified: 2014-10-27
I have an access database and an excel spreadsheet that are set up to generate emails in outlook.  These have always worked without any issue, but since the end of last week, although the email window is created as normal, when the user clicks on the 'Send' button, Outlook generates and error - "The operation failed."

However, if I open Outlook and then create a new email message and copy and paste the information to this new email window, it sends without error.

I am using Office 2010 in a Terminal Server environment, and Outlook is connected to an Exchange 365 server.  I have tried restarting the server and deselected and reselected the appropriate library files within access and this has not fixed the problem.  I'm guessing there may have been an update that is causing me problems.

Please help!
0
Comment
Question by:thechrisrobertstoo
  • 4
  • 4
8 Comments
 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40396555
First thing to do is make sure Office and Windows are fully updated, including all Service Packs and relevant Hotfixes.

Might want to check the Event Viewer on the machine immediately after this fails, see if you find any MAPI or other relevant errors.

Does the email have an attachment? If so, try using Access to send the email only, without the attachment, and see if it fails.

Otherwise, I'd try using your code to create the simplest email you could - just a SendTo, Subject and Body - and see if that goes through. If it does, start adding other attributes your code uses, and see where/when it fails.
0
 

Author Comment

by:thechrisrobertstoo
ID: 40396625
Ok, this is interesting, because having written a very simple subroutine to just generate an email for me to send, it works correctly, but the crux of the mail generating code is the same as what I'm using in my Access form.  I don't have anything more complicated than subject and body text, I don't even complete the 'To' field as this is not useful for this process.

Still driving me nuts!  Unfortunately I have an urgent need to work on something else, so I will have to leave this until tomorrow.
0
 
LVL 84
ID: 40396670
You may have some corruption in the database file. Try creating a new, blank database and importing everything to that database, and see if the trouble goes away.
0
 

Author Comment

by:thechrisrobertstoo
ID: 40396674
I might agree, except I experience the exact same issue when generating emails from an Excel spreadsheet.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 84
ID: 40396747
Does this happen on multiple RDS desktops, or only one?

If it's only one, you might have a corrupt user profile. If so, then you generally have to recreate that profile.

If it happens on multiple RDS desktops, then my guess would be inconsistency in the install of Outlook on the RDS system. You'll very likely have a difficult time convincing the IT people of that, of course.

deselected and reselected the appropriate library files within access
Are you using early or late binding? If you're using Early binding (where you write code like Dim otl As Outlook.Application), you might try switching over to Late binding.

Also - are all users of the database running the same version of Access, and the same version of Outlook? Generally this is the way things work, but I've seen some situations where RDS systems were configured differently.
0
 

Accepted Solution

by:
thechrisrobertstoo earned 0 total points
ID: 40396783
Yes, it happens for all users, and they all use the same version of Access.  I'm also using early binding.

Because I'm like a dog with a bone, I haven't been able to leave this alone and have found that if I call a separate subroutine to handle the email window AND if I remove the code that determines the BodyFormat of the email (normally set to olFormatPlain), I've managed to get it working.

It occurs to me that these failures only started after a routine re-boot of the TS server, though I can't for the life of me think why any security updates would object to email BodyFormats.

Now all I need to do is test it a bit more and then roll out these changes to my Excel spreadsheet as well.

I appreciate all your helpful suggestions, many thanks.
0
 
LVL 84
ID: 40396896
That is very odd ... rebooting the machine shouldn't have any impact on that, it would seem - but then who knows.

Still think it would be prudent to perform maintenance on your database. Make a backup, then do this:

1. Compact the database
2. Compile the database - from the VBA Editor, click Debug - Compile. Fix any errors, and continue doing this until the menu item is disabled.
3. Compact again

Might also want to Decompile the app. To do that, create a shortcut with this as the Target:

"full path to msaccess.exe" "full path to your db" /decompile

Run this shortcut, then do the 3 steps above again.

Finally, it's sometimes a good idea to create a new, blank database and import everything to that db. This can clear up any container corruption you might have.

But be sure to make a backup before you start anything ...
0
 

Author Closing Comment

by:thechrisrobertstoo
ID: 40405951
The solution turned out to be trial and error, though I never addressed the cause of the issue.  Scott was very helpful in encouraging a step-by-step approach to solving this so he can have all the points.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Check out this infographic on what you need to make a good email signature that will work perfectly for your organization.
Sometimes Outlook might have problems sending a message. There may be various causes- corrupted PST, AV scanner etc. The message, instead of going to the Sent Items folder, sits in the Outbox indefinitely. To remove it you can use a free tool cal…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now