Discussion Locked

sendobject and access97

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a workorder database ( access 97)
where I try to send e-mail responses
with a command button when the work is done.
I use this in the event procedure
command button
----------
Dim stinfo As String

stinfo = "Your work order no. " +
Me![W O Number] + " has been done"

DoCmd.SendObject acSendNoObject, , acFormatTXT, Me![email], , ,
"Confirmation of Work Order", stinfo, True
------------
where Me![W O Number] and Me![email] are
varables from the access form.

This works on a windows 95 machine but not on a windows 98 or XP machine.
The error message is 2046, command or action sendobject isn't available now.
From this I would thank it is a machine config issue ruther than a programproblem;
but I do not know what. All other aspects of
the mail client work; some have said MAPI may
not be configured right.
Thanks for you help.

Steve

3 replies

by jhermiz

Hi Steve,

If this is a different machine its not the OS that may be causing this problem. Its a matter of Access references. In a code window goto tools->references (to get to a code window simply click the little vb code square at the top nearthe menu bar). Take a look at what references are being used in your windows machine as opposed to your other machines. Uncheck any references that may say "Missing". Also a better solution is not to use the SendObject command..its very buggy. If you and your co-workers use Outlook I'd learn more towards the Outlook object right from access. From there creating and sending email is a lot cleaner and you have more control as to what properties you want to set in the email.

Dim objApp As Object
Dim objEmailItem As MailItem
Dim objNS As NameSpace

Use these 3 variables to start ya off...then sending the email is simple. Just create the Outlook.Application reference, followed by setting the name space. Create a MailItem and checkout the properties .Add, .Recipients, .Save, and .Send. More help is available in Access / Outlook.

Good Luck,
Jon H.

by steved77

Although only one of the machines used outlook it was an outlook problem. No matter what mail client was used outlook express had to be installed; as it put the mapiX protocol under
the [MAIL] in win.ini and installed the proper 'dll' files.
Thanks for you help

This discussion is closed to new replies.