Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / February 2007

Tip: Looking for answers? Try searching our database.

SendObject

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Bunton - 27 Feb 2007 15:56 GMT
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 = "DummyOne1@Blueyonder.co.uk"
   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 **
Signature

Jim Bunton

Jim Bunton - 28 Feb 2007 16:13 GMT
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 = "DummyOne1@Blueyonder.co.uk"
     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 **
 --
 Jim Bunton
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.