Solved

Docmd.SendObject not working

Posted on 2007-11-23
13
1,157 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
ID: 20340818
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
ID: 20340870
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
ID: 20340908
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 65

Expert Comment

by:rockiroads
ID: 20340918
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
ID: 20340923
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
ID: 20341353
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
 
LVL 44

Author Comment

by:GRayL
ID: 20346624
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
ID: 20346805
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
ID: 20654279
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
ID: 31410699
Thanks again.  Sometimes the sleeping dogs must lay for a while;-)
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 20660827
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
ID: 20665722
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
ID: 20669276
;)
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pegasus Mail (http://www.pmail.com/) is a donation ware that is a collaboration of David Harris along with his team members. It is a desktop mail client that offers the option of configuring more than one mail account with single set up. It supports…
Explore the encryption capabilities built into Google Apps and how these features can help you meet privacy policy and regulatory compliance, but are not a full solution. Understand and compare the most popular email encryption services for Google A…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
This Micro Tutorial will demonstrate the easy use of Gmail embedding images in your email so the recipient of your email can view them in context.

813 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

15 Experts available now in Live!

Get 1:1 Help Now