By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

MS Access - Email Automation stops

P: n/a
Hello all,
I am trying to send email via Access. When performing this below routine the
program stops at what I called
the P R O B L E M L I N E.
I have Microsoft Outlook as the default emailprog.
The errormessage I get is :

-2147467259 (80004005)
Automation error
Unspecifeid error
Does anybody know what this is and how tro prevent it ?

Many thanks.

Ronny sigo

Private Sub btnSendFirstMail_Click()
Dim nLast As Long
DoCmd.GoToRecord , , acLast
nLast = [ContactID]
DoCmd.GoToRecord , , acFirst
Do While nLast <> [ContactID] ' Check for end of file.

If [To_mail] = True Then

Dim objSession As Object
Dim objMessage As Object
Dim objRecipient As Object
Dim sProfile As String
Dim sSubjPrmpt As String
Dim sTextPrmpt As String
Dim sEmailPrmpt As String
Dim sMsgTitle As String

' Leaving sProfile equal to Null will
' force the user to select which Mapi
' profile to use. To keep from being
' prompted, you must supply a valid
' user profile.
sProfile = "Ronny Sigo"
sEmailPrmpt = Me!EmailName.Value
sSubjPrmpt = "Uw vraag om inlichtingen"
sTextPrmpt = "Geachte" & vbCr & "Ik was zeer verheugd uw email met
vraag om inlichten" & _
"over de XXXX - te ontvangen. Het gaat hier over een wereldwijde" &
_
"Consumers-co÷peratieve die voor U als Free Member niets dan
voordelen biedt" & vbCr

sMsgTitle = "XXXX - "

' Create the Session Object.
Set objSession = CreateObject("mapi.session") <---- P R O B L E M
L I N E

Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Ronny Sigo" <ro********@example.invalid> wrote in message
news:3f*********************@reader3.news.skynet.b e...
Hello all,
I am trying to send email via Access. When performing this below routine the program stops at what I called
the P R O B L E M L I N E.
I have Microsoft Outlook as the default emailprog.
The errormessage I get is :

-2147467259 (80004005)
Automation error
Unspecifeid error
Does anybody know what this is and how tro prevent it ?

Many thanks.

Ronny sigo

Private Sub btnSendFirstMail_Click()
Dim nLast As Long
DoCmd.GoToRecord , , acLast
nLast = [ContactID]
DoCmd.GoToRecord , , acFirst
Do While nLast <> [ContactID] ' Check for end of file.

If [To_mail] = True Then

Dim objSession As Object
Dim objMessage As Object
Dim objRecipient As Object
Dim sProfile As String
Dim sSubjPrmpt As String
Dim sTextPrmpt As String
Dim sEmailPrmpt As String
Dim sMsgTitle As String

' Leaving sProfile equal to Null will
' force the user to select which Mapi
' profile to use. To keep from being
' prompted, you must supply a valid
' user profile.
sProfile = "Ronny Sigo"
sEmailPrmpt = Me!EmailName.Value
sSubjPrmpt = "Uw vraag om inlichtingen"
sTextPrmpt = "Geachte" & vbCr & "Ik was zeer verheugd uw email met
vraag om inlichten" & _
"over de XXXX - te ontvangen. Het gaat hier over een wereldwijde" & _
"Consumers-co÷peratieve die voor U als Free Member niets dan
voordelen biedt" & vbCr

sMsgTitle = "XXXX - "

' Create the Session Object.
Set objSession = CreateObject("mapi.session") <---- P R O B L E M
L I N E


Do you have anti-virus software running?
If so, try switching it off and running your code.
What happens?

Fletcher


Nov 12 '05 #2

P: n/a
Hello Fletcher,
Many thanks, I stopped the antivirus software. I'm not out of my problems
yet, but at least the prog does not stop anymore at the line I spoke off
......
Thanks

"Fletcher Arnold" <fl****@home.com> wrote in message
news:bn**********@sparta.btinternet.com...
"Ronny Sigo" <ro********@example.invalid> wrote in message
news:3f*********************@reader3.news.skynet.b e...
Hello all,
I am trying to send email via Access. When performing this below routine the
program stops at what I called
the P R O B L E M L I N E.
I have Microsoft Outlook as the default emailprog.
The errormessage I get is :

-2147467259 (80004005)
Automation error
Unspecifeid error
Does anybody know what this is and how tro prevent it ?

Many thanks.

Ronny sigo

Private Sub btnSendFirstMail_Click()
Dim nLast As Long
DoCmd.GoToRecord , , acLast
nLast = [ContactID]
DoCmd.GoToRecord , , acFirst
Do While nLast <> [ContactID] ' Check for end of file.

If [To_mail] = True Then

Dim objSession As Object
Dim objMessage As Object
Dim objRecipient As Object
Dim sProfile As String
Dim sSubjPrmpt As String
Dim sTextPrmpt As String
Dim sEmailPrmpt As String
Dim sMsgTitle As String

' Leaving sProfile equal to Null will
' force the user to select which Mapi
' profile to use. To keep from being
' prompted, you must supply a valid
' user profile.
sProfile = "Ronny Sigo"
sEmailPrmpt = Me!EmailName.Value
sSubjPrmpt = "Uw vraag om inlichtingen"
sTextPrmpt = "Geachte" & vbCr & "Ik was zeer verheugd uw email met vraag om inlichten" & _
"over de XXXX - te ontvangen. Het gaat hier over een wereldwijde" &
_
"Consumers-co÷peratieve die voor U als Free Member niets dan
voordelen biedt" & vbCr

sMsgTitle = "XXXX - "

' Create the Session Object.
Set objSession = CreateObject("mapi.session") <---- P R O B L E

M L I N E


Do you have anti-virus software running?
If so, try switching it off and running your code.
What happens?

Fletcher

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.