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

Help with error in trying to email from Access...

P: n/a
Hey everyone,

I'm trying to email from access and i want email the contents of one
field with a subject of another to the owner of a final field.

I think i've referred to everything correctly in the ocde below but I
get an error message:

Run-time error '-2147352567 (800200009)':

The operation failed.

This appears after the message "A program is trying yo access
email..." to which i say yes.

I'm using Access XP with all the relevant libraries referenced.

Thanks.

*************Begin Code************
Private Sub Command44_Click()

Dim myOlApp, myMessage

Set myOlApp = CreateObject("Outlook.Application")
Set myMessage = myOlApp.CreateItem(olMailItem)

With myMessage
..Recipients = Me.ThingyOwner
..Resolve
..Subject = Me.ThingyTitle
..Body = Me.ThingyDescription
End With
myMessage.Send

Set myOlApp = Nothing

End Sub
*************End Code************
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Robert McGregor wrote:
Hey everyone,

I'm trying to email from access and i want email the contents of one
field with a subject of another to the owner of a final field.

I think i've referred to everything correctly in the ocde below but I
get an error message:

Run-time error '-2147352567 (800200009)':

The operation failed.

This appears after the message "A program is trying yo access
email..." to which i say yes.

I'm using Access XP with all the relevant libraries referenced.

Thanks.

*************Begin Code************
Private Sub Command44_Click()

Dim myOlApp, myMessage

Set myOlApp = CreateObject("Outlook.Application")
Set myMessage = myOlApp.CreateItem(olMailItem)

With myMessage
.Recipients = Me.ThingyOwner
.Resolve
.Subject = Me.ThingyTitle
.Body = Me.ThingyDescription
End With
myMessage.Send

Set myOlApp = Nothing

End Sub
*************End Code************


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.