Solved

Docmd.SendObject not working

Posted on 2007-11-23
13
1,131 Views
Last Modified: 2012-08-13
When I tried this code line in the Immediate Pane:

docmd.SendObject acSendNoObject,,,"Ray Learmond",,,"A Little Test","This is a test"

I get the error message Runtime Error 2046 - blah, blah.

I tried to unregister and register Mapi32.dll and I got this message:

C:\Windows\System32\Mapi32.dll was loaded, but the DllRegisterServer entry point was not found.  The file cannot be registered.

I use Outlook for Email and Firefox as my browser running on XP Home with SP3
0
Comment
Question by:GRayL
  • 6
  • 4
  • 3
13 Comments
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
Hi Ray

This this code use to work before?

Whats your default email client set as?

If you specified a valid email address rather than outlook name, does it make a difference?

Regarding mapi, I dont think you can register that manually. Its installed/registered when you install outlook/exchange wherever its in.
0
 
LVL 44

Author Comment

by:GRayL
Comment Utility
Hi rocki:

I believe so

Outlook 2000

No

Email with Outlook is working well.  I was troubleshooting an EE problem and tried to send an Email from Access and to my surprise...
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
I tried your exact line and it worked fine

have you tried different variations of send object, perhaps send results of a query, fill in output type etc - just for experimenting.
If a full valid line fails then a bigger problem!!!

Just out of interest, does outlook and cdo automation work?
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
Just as a test, cos you know how flaky Access is, have u tried a compact/repair - usual checks for corruptness. Probably not that, but its one check I always do to rule out things
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 250 total points
Comment Utility
Another thing, you do have all the latest service packs, right? both for office and windows,  but more importantly for office
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 250 total points
Comment Utility
GRayL,

I, like rockiroads, could not duplicate your issue.

Here is what I tried:
DoCmd.SendObject acSendNoObject, , , "ALFKI.ALFKI@ALKI.net", , , "A Little Test", "This is a test" 'Using Full Email address as recipient
DoCmd.SendObject , , , "ALFKI.ALFKI@ALKI.net", , , "A Little Test2", "This is a test2" 'Not using the default "acSendNoObject"
DoCmd.SendObject acSendNoObject, , , "ALFKI ALFKI", , , "A Little Test3", "This is a test3" 'Using the Oulook Alias as the recipient
DoCmd.SendObject acSendNoObject, , , "ALFKI.ALFKI@ALKI.net", , , "A Little Test4", "This is a test4" 'Database window hidden, ref.:http://support.microsoft.com/kb/q244695/

All 4 worked fine.

I know you are using Off 2k.
This is 2003 specific, but who knows?
http://support.microsoft.com/kb/834008


Jeff
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 44

Author Comment

by:GRayL
Comment Utility
Strange.  I can open Word, click on the Send Email icon in the tool bar, up pops the Mail format, type in Ray Learmond, subject - A Short Test, body - A short test from Word, append a photo and click send.  20 seconds later, there's my Email.  Yet Access cannot find Outlook, which is my Email application using docmd.sendobject.
0
 
LVL 44

Author Comment

by:GRayL
Comment Utility
Also discovered there are two versions of mapi32.dll on the machine at??

C:\Windows\System32\mapi32.dll   -   ver 1.0.2536.0

C:\Program Files\Common Files\System\Mapi\1033\NT\Mapi32.dll    -   ver 1.0.2518.0
Under Comments in Properties - Service Pack 2





0
 
LVL 44

Author Comment

by:GRayL
Comment Utility
docmd.SendObject acSendNoObject,,,"Ray Learmond",,,"A Short Test","This is a docmd.sendobject test from Access",False

I ran this code line from the Immediate Pane and it is now working just fine.  BTW I am using Firefox as my browser, and after my last auto-update from MS, I decided to give it another whirl, and presto.

Boag and rocki - I'm splitting the points, thanks.
0
 
LVL 44

Author Closing Comment

by:GRayL
Comment Utility
Thanks again.  Sometimes the sleeping dogs must lay for a while;-)
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
GRayL,

Hey!

Happy New year!
:)

<docmd.SendObject acSendNoObject,,,"Ray Learmond",,,"A Short Test","This is a docmd.sendobject test from Access",False>

... so just setting the "Edit message " parameter to: "False" fixed it?

JeffCoachman

0
 
LVL 44

Author Comment

by:GRayL
Comment Utility
Jeff:  Not sure.  As I said, I had an auto-update run a few days ago, I then I checked my open questions, found this one, decided to 'try it one more time' - and it worked,  both with and without the 'Edit message' parameter set.  Who knows??  Happy New Year!

Ray
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
Comment Utility
;)
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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

18 Experts available now in Live!

Get 1:1 Help Now