J
Jeff Byrd
It was suggested in the Access newsgroup that I post this question to an
Outlook newsgroup.
I am Attempting to send e-mails to muultiple individuals from MS Access
2003. I use Outlook 2003 with an Exchange 2003 account. I also run Norton
Enterpise Antivirus.
I have Microsoft Outlook 11.0 Object Library checked in References. My code
compiles fine.
However when I try to run it I the following:
Private Sub CreateMail()
' Customize a message for each contact and then send or save the message
Dim intMessageCount As Integer
Dim mobjOutlook As Object
'Declare and instantiate a recordset object
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
'Open a recordset based on the result of qryBulkMail
rst.Open "qryTestemail", CurrentProject.Connection
intMessageCount = 0
Set mobjOutlook = CreateObject("Outlook.Application")
' Loop through the contacts in the open folder
Do Until rst.EOF
intMessageCount = intMessageCount + 1
rst.MoveNext
Loop
' Write the number of messages created to the worksheet
MsgBox intMessageCount & " Messages Sent"
End Sub
I get:
Run-time Error '-2147024770(8007007e)
Automation Error
The specific module could not be found.
I have also tried to run the following module.
Running the following Module returns the msg "Couldn't Launch Outlook!".
Function CreateOutlookObj() As Boolean
'Invoke error handling
On Error GoTo CreateOutlookObj_Err
'Assume a False return value
CreateOutlookObj = False
'Attempt to Launch Outlook
Set gobjOutlook = New Outlook.Application
'If Outlook launches successfully, return true
CreateOutlookObj = True
CreateOutlookObj_Exit:
Exit Function
CreateOutlookObj_Err:
'If an error occurs, display a message and return false
MsgBox "Couldn't Launch Outlook!!", vbCritical, "Warning!!"
CreateOutlookObj = False
Resume CreateOutlookObj_Exit
End Function
I have tried the last function for opening MS Word and MS Excel and they
work fine.
I am sure that I am missing something here but what? Does Outlook have some
addition security settings. We run an Enterprise version of Norton Antivius
if that makes any difference.
Is there another way to automate sending e-mail without using Outlook when
you are running Exchange?
Any thoughts?
Outlook newsgroup.
I am Attempting to send e-mails to muultiple individuals from MS Access
2003. I use Outlook 2003 with an Exchange 2003 account. I also run Norton
Enterpise Antivirus.
I have Microsoft Outlook 11.0 Object Library checked in References. My code
compiles fine.
However when I try to run it I the following:
Private Sub CreateMail()
' Customize a message for each contact and then send or save the message
Dim intMessageCount As Integer
Dim mobjOutlook As Object
'Declare and instantiate a recordset object
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
'Open a recordset based on the result of qryBulkMail
rst.Open "qryTestemail", CurrentProject.Connection
intMessageCount = 0
Set mobjOutlook = CreateObject("Outlook.Application")
' Loop through the contacts in the open folder
Do Until rst.EOF
intMessageCount = intMessageCount + 1
rst.MoveNext
Loop
' Write the number of messages created to the worksheet
MsgBox intMessageCount & " Messages Sent"
End Sub
I get:
Run-time Error '-2147024770(8007007e)
Automation Error
The specific module could not be found.
I have also tried to run the following module.
Running the following Module returns the msg "Couldn't Launch Outlook!".
Function CreateOutlookObj() As Boolean
'Invoke error handling
On Error GoTo CreateOutlookObj_Err
'Assume a False return value
CreateOutlookObj = False
'Attempt to Launch Outlook
Set gobjOutlook = New Outlook.Application
'If Outlook launches successfully, return true
CreateOutlookObj = True
CreateOutlookObj_Exit:
Exit Function
CreateOutlookObj_Err:
'If an error occurs, display a message and return false
MsgBox "Couldn't Launch Outlook!!", vbCritical, "Warning!!"
CreateOutlookObj = False
Resume CreateOutlookObj_Exit
End Function
I have tried the last function for opening MS Word and MS Excel and they
work fine.
I am sure that I am missing something here but what? Does Outlook have some
addition security settings. We run an Enterprise version of Norton Antivius
if that makes any difference.
Is there another way to automate sending e-mail without using Outlook when
you are running Exchange?
Any thoughts?