Email (SendObject) works for some and not others.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro (using Access 2002) that does a SendObject to notify users
that a problem has been logged and the number assigned to the problem. There
are 11 different users and depending on who logs the problem depends on who
is notified (using Outlook 2003).

I have been testing this with each user and it works for some and not for
others. Those it works for receive a dialog box stating "A program is
automatically trying to send email. Do you want to continue?" Nothing at
all happens for some when the button is clicked. The Access application is
the same for everyone because it came from a Ghost Image. Outlook was
installed individually. What would cause this to work for some and not
others? Any help I can get is greatly appreciated...thank you.
 
SendObject is not reliable with Outlook 2000 and above. Sometimes it works,
sometimes it fails with an error, sometimes it fails silently. See this
article:
http://absolutewrite.com/forums/showthread.php?t=729&goto=newpost

A better bet is to use Office Automation to automate Outlook. Here's
another article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q161088&ID=kb;en-us;Q161088

Here are also a couple of samples developed to handle this:
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='CodeSendEMailToAll.mdb'
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='CodeSendEMailToOne.mdb'
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='Emails.mdb'

And a different solution using Blat:
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='blat.adp'

Note: watch for word wrap on the links!
--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Roger Carlson said:
Well, that IS embarassing. That's a link to a writers board I
participate on. Must have been in the clipboard.
The actual link to the SendObject reliability article should have
been: http://support.microsoft.com/default.aspx?scid=KB;en-us;q260819

(Good catch, Dick)

Glad to oblige. Now that I see the article you were referring to,
though, I wouldn't interpret it as saying that SendObject is "not
reliable with Outlook 2000 and above". Do you have further information
on the subject? As I read the article, it's describing a bug in
SendObject for A2K that isn't related to Outlook. I was aware of that
bug, but I believe (and the article asserts) that the bug was fixed by
Office 2000 Service Pack 3. Are you thinking of some other bug I
haven't heard of yet, or do you know more about this bug than is stated
in the KB article?
 
As I recall, it was not so much a bug in Access as it was that the Outlook
Security Update (that came with Office 2000 SR1) caused it. (I'm going from
memory here.)

Here are additional links:
http://support.microsoft.com/kb/264128/EN-US/
http://support.microsoft.com/kb/263245/
http://support.microsoft.com/kb/263084/EN-US/

I see that the article in question has been updated recently. It doesn't
match my memory of it, especially the SR3 fix. The only fix I remember was
to use Office Automation, and I've been advising people to do that ever
since. Perhaps I don't need to anymore, but it does seem to fit the
original question (both the symptoms and solution).

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Roger Carlson said:
As I recall, it was not so much a bug in Access as it was that the
Outlook Security Update (that came with Office 2000 SR1) caused it.
(I'm going from memory here.)

Here are additional links:
http://support.microsoft.com/kb/264128/EN-US/
http://support.microsoft.com/kb/263245/
http://support.microsoft.com/kb/263084/EN-US/

Right. I know about those. What a pain that security update has been
to people who have legitimate reasons to automate e-mails!
I see that the article in question has been updated recently. It
doesn't match my memory of it, especially the SR3 fix. The only fix
I remember was to use Office Automation, and I've been advising
people to do that ever since. Perhaps I don't need to anymore, but
it does seem to fit the original question (both the symptoms and
solution).

Could be, except that Ann said she was using Access 2002. But maybe
some of her users are using an unpatched version of Access 2000. That
would explain it. When she said she was using Access 2002, I didn't
think of that possibility.
 
Hi, I was just wondering if I should still be using the original fix of
"Using Automation to Send a Microsoft Outlook Message"? Also, when I clicked
on the other links all I received was:

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

/Otherdownload.asp, line 32
 
Ann said:
Hi, I was just wondering if I should still be using the original fix
of "Using Automation to Send a Microsoft Outlook Message"?

Is Roger right about the circumstances? Are the users for whom this is
failing using Access 2000 without service pack 3 applied? If so, you
would do well to have them bring apply all relevant service packs, and
then maybe the problem will go away. A lot of bugs were fixed in the
various service packs -- some of them quite nasty.

If unpatched Access 2000 is the cause of the problem, but you can't get
your users to patch their systems, then you should probably be using
either Outlook automation or MAPI to send your e-mails. That is, you
can use Outlook automation provided that you're sure all users will have
Outlook installed on their PCs. (If not, you're probably best just
using MAPI.)

If this is *not* the problem, then I don't know where the problem lies.
If you've stepped through the code and narrowed it down to the call to
SendObject, then probably you should go ahead and try automation or MAPI
anyway.
Also,
when I clicked on the other links all I received was:

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are
in conflict with one another.

/Otherdownload.asp, line 32

The links in Roger's message? They all worked for me. Or are you
talking about some other links, on one or another of the web pages Roger
pointed to?
 
We are using 2002 and it has SP3 but the message said it was a problem with
2000 and above.

We are already using MAPI. It said that was the only way we could use
Outlook with our applications and the macro is correct. I was hoping it
would be as simple as a setting in Outlook that needed to be changed. Thanks
for your help.
 
Ann said:
We are using 2002 and it has SP3 but the message said it was a
problem with 2000 and above.

I think Roger was mistaken in that. I'm not aware of any ongoing
problems with SendObject after Access 2000 SP3. SP3 for Office 2002 is
a different update. That is, I'm not aware of any problems except the
confirmation prompts required by the e-mail security update. But my
understanding was that your real problem was that SendObject sometimes
simply didn't operate at all. That's the problem I've been talking
about.
We are already using MAPI. It said that was the only way we could use
Outlook with our applications and the macro is correct. I was hoping
it would be as simple as a setting in Outlook that needed to be
changed. Thanks for your help.

Now I'm confused. If you're using the built-in SendObject method
(DoCmd.SendObject) then you're not using MAPI (except in that Access may
be using MAPI behind the scenes).
 
am using SendObject in a macro. The Client is on our desktop, the rest is
on a network server. Support said sending mail automatically doesn't work
without MAPI but we were setup properly and I shouldn't have a problem. And
yes, you are correct, my real problem is that SendObject sometimes simply
doesn't operate at all. Out of seven people only one person's doesn't work.
I do this in other databases and this is the first time I have had a problem.
In fact the person it doesn't work for used it in a different database all
last year without a problem. The only difference is that now it is sending
to multiple recipients instead of just one. I'm extremely confused and have
no idea where to look. I appreciate your help.
 
Ann said:
am using SendObject in a macro. The Client is on our desktop, the
rest is on a network server. Support said sending mail automatically
doesn't work without MAPI but we were setup properly and I shouldn't
have a problem. And yes, you are correct, my real problem is that
SendObject sometimes simply doesn't operate at all. Out of seven
people only one person's doesn't work. I do this in other databases
and this is the first time I have had a problem. In fact the person
it doesn't work for used it in a different database all last year
without a problem. The only difference is that now it is sending to
multiple recipients instead of just one. I'm extremely confused and
have no idea where to look. I appreciate your help.

I'm rather perplaxed, too, but let's see if we can figure out what's
wrong. Please clarify: when you say you are using SendObject "in a
macro", do you mean a real macro, as shown on the Macros tab of the
database window, or are you referring to a VBA procedure?

For the one person for whom it doesn't work, does it *never* work, or
sometimes yes, sometimes no?

Is there VBA code involved at all, or is it all macros?

Have you checked for a missing or broken reference on the one PC where
it's failing, according to Doug Steele's instructions posted here:

http://www.accessmvp.com/djsteele/AccessReferenceErrors.html

?
 
It's a macro on the macros tab of the database window, no VBA procedure.
There are 11 conditions. One for each user, ex. ([txtUserId] like
"AMV5520"), if the condition is met do the SendObject. This sends to
everyone but the user who logged the problem and it inserts the log no. into
the text of the message that gets sent to the other 10 users. For this
person it never works in this database, but SendObject has worked for her in
a completely different one we used last year. The one from last year only
had 1 recipient and this one has 10.

I hadn't checked the references but just did and none are marked as "Missing".

I'm not a programmer but would it be better to use a VBA procedure instead?
I did come across some and can figure it out enough if I have to change
something.
 
Ann said:
It's a macro on the macros tab of the database window, no VBA
procedure. There are 11 conditions. One for each user, ex.
([txtUserId] like "AMV5520"), if the condition is met do the
SendObject. This sends to everyone but the user who logged the
problem and it inserts the log no. into the text of the message that
gets sent to the other 10 users. For this person it never works in
this database, but SendObject has worked for her in a completely
different one we used last year. The one from last year only had 1
recipient and this one has 10.

I'd love to blame the macro, but if the same macro works for everybody
else, that's hard to do.
I'm not a programmer but would it be better to use a VBA procedure
instead?
I did come across some and can figure it out enough if I have to
change something.

In general, VBA code is more powerful, more flexible, and easier to
debug. I generally recommend using it instead of macros if you feel up
to it, but not everyone is a programmer. If you want to give it a try,
I'll be glad to help you. If you want me to, post back with the details
of every action in the macro. I'd need that anyway if I were to try and
debug the macro.
 
I would appreciate your help...thank you very much.

Here is the macro information.
Name: Email,
Condition: ([txtUserId] Like "AMV5520") one for each user with their User Id.
SendObject
To property:
(e-mail address removed);[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected];[email protected]
Subject: Problem Logged
Message Text: ="Please check Problem Log Number" & " " &
[lngProblemResolutionId] & "."
Edit Message: No

Dirk Goldgar said:
Ann said:
It's a macro on the macros tab of the database window, no VBA
procedure. There are 11 conditions. One for each user, ex.
([txtUserId] like "AMV5520"), if the condition is met do the
SendObject. This sends to everyone but the user who logged the
problem and it inserts the log no. into the text of the message that
gets sent to the other 10 users. For this person it never works in
this database, but SendObject has worked for her in a completely
different one we used last year. The one from last year only had 1
recipient and this one has 10.

I'd love to blame the macro, but if the same macro works for everybody
else, that's hard to do.
I'm not a programmer but would it be better to use a VBA procedure
instead?
I did come across some and can figure it out enough if I have to
change something.

In general, VBA code is more powerful, more flexible, and easier to
debug. I generally recommend using it instead of macros if you feel up
to it, but not everyone is a programmer. If you want to give it a try,
I'll be glad to help you. If you want me to, post back with the details
of every action in the macro. I'd need that anyway if I were to try and
debug the macro.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top