SendObject

J

Jim Bunton

Windows xp, Access 2000 Outlook Express 6

I am using DoCmd.SendObject to send emails - just sending a message text but no object.

I run the code -
SendObject works once - one email is placed in the outbox - but then does nothing (no error is generated)
It will only work again by closing down the Access application and reopening it.
[I would swear it worked fine earlier in the day generating multiple emails!]

Tried:
[Rebooting the computer - same problem: works once then not again]

[Cutting out the loop which repeats SendObject - works once then on activating the function again does nothing]

! mystified ! ?? any suggestions ??

** Code **

Public Function mySendEmails_withSendObject()
On Error GoTo Err_mySEndEmails_withSEndObject
Dim objectType As Integer
Dim objectName As String
Dim outputformat As String
Dim sendTo As String
Dim sendCc As String
Dim sendBcc As String
Dim sendSubject As String
Dim sendMessage As String
Dim editmessage As Boolean
Dim templateFileName As String
'for debug
Dim nRecepients As Integer

objectType = acSendNoObject
objectName = ""
outputformat = ""
sendTo = "(e-mail address removed)"
sendCc = ""
sendBcc = ""
sendSubject = "Test auto emailing"
sendMessage = "test msg content" & vbNewLine & "Next Line" & vbNewLine
sendMessage = sendMessage & " this and that and this and that "
editmessage = False
templateFileName = ""

For nRecepients = 1 To 3
'will assign new values to sendTo
DoCmd.SendObject objectType, objectName, outputformat, sendTo, sendCc, sendBcc, sendSubject, sendMessage, editmessage, templateFileName
Next 'nRecepients
MsgBox "Emails sent", vbOKOnly, "End"

Exit_Err_mySEndEmails_withSEndObject:
Exit Function

Err_mySEndEmails_withSEndObject:
Dim errMsg As String
errMsg = Err & " " & Err.Description
MsgBox errMsg, vbOKOnly, "Auto eMail error"
Resume Exit_Err_mySEndEmails_withSEndObject
End Function

** END CODE **
 
J

Jim Bunton

The problem with SendObject:
Only sends once In Access 2000

Resolution:- Install Service Pack 3 for Office
Details at
http://support.microsoft.com/kb/260819/en-us
Windows xp, Access 2000 Outlook Express 6

I am using DoCmd.SendObject to send emails - just sending a message text but no object.

I run the code -
SendObject works once - one email is placed in the outbox - but then does nothing (no error is generated)
It will only work again by closing down the Access application and reopening it.
[I would swear it worked fine earlier in the day generating multiple emails!]

Tried:
[Rebooting the computer - same problem: works once then not again]

[Cutting out the loop which repeats SendObject - works once then on activating the function again does nothing]

! mystified ! ?? any suggestions ??

** Code **

Public Function mySendEmails_withSendObject()
On Error GoTo Err_mySEndEmails_withSEndObject
Dim objectType As Integer
Dim objectName As String
Dim outputformat As String
Dim sendTo As String
Dim sendCc As String
Dim sendBcc As String
Dim sendSubject As String
Dim sendMessage As String
Dim editmessage As Boolean
Dim templateFileName As String
'for debug
Dim nRecepients As Integer

objectType = acSendNoObject
objectName = ""
outputformat = ""
sendTo = "(e-mail address removed)"
sendCc = ""
sendBcc = ""
sendSubject = "Test auto emailing"
sendMessage = "test msg content" & vbNewLine & "Next Line" & vbNewLine
sendMessage = sendMessage & " this and that and this and that "
editmessage = False
templateFileName = ""

For nRecepients = 1 To 3
'will assign new values to sendTo
DoCmd.SendObject objectType, objectName, outputformat, sendTo, sendCc, sendBcc, sendSubject, sendMessage, editmessage, templateFileName
Next 'nRecepients
MsgBox "Emails sent", vbOKOnly, "End"

Exit_Err_mySEndEmails_withSEndObject:
Exit Function

Err_mySEndEmails_withSEndObject:
Dim errMsg As String
errMsg = Err & " " & Err.Description
MsgBox errMsg, vbOKOnly, "Auto eMail error"
Resume Exit_Err_mySEndEmails_withSEndObject
End Function

** END CODE **
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DoCmd.SendObject 1
Send email from access form 3
email as a pdf 1
email forms and reports 1
Email issue 0
SendObject Action Message 1
DoCmd.SendObject and Signatures 0
email in access 2

Top