errors generating email message from an Access 2000 app...

B

Brad Pears

I have some code that allows me to generate an email from within Access.
When this code is run on my Windows XP machine or our Windows 2003 terminal
server it works fine. However, when it runs on our Windows 2000 terminal
server it crashes every time. The exact same version of access is installed
on each machine (Access 2000) and the same Outlook clients are being used
(Outlook 2002) Also, we are using an Exchange 2000 server.

The references in th eproject to get this code to work is the "Microsoft
Outlook 10.0 Object Library".

The code is as follows and it crashes everytime with an error message of
"-2113732605: The operation failed" on the following line....

Set objEmail = objOutlook.CreateItem(olMailItem)


Here is the whole procedure...

Private Sub Command0_Click()
'Arvin Meyer 03/12/1999
'Updated 7/21/2001
On Error GoTo Error_Handler

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
.To = "(e-mail address removed)"
.Subject = "Look at this sample attachment"
.body = "The body doesn't matter, just the attachment"
.Attachments.Add "C:\Test.htm"
'.attachments.Add "c:\Path\to\the\next\file.txt"
.Send
'.ReadReceiptRequested
End With

Exit_Here:
Set objOutlook = Nothing
Exit Sub

Error_Handler:
MsgBox Err & ": " & Err.Description
Resume Exit_Here

End Sub



Can anyone help??

Thanks,

Brad
 
G

Guest

I had a simular problem with 2000. Updating to the latest service pack fixed
the problem. Hope this helps.
 
G

Guest

I had a simular problem with 2000. Updating to the latest service pack fixed
it. Hope this helps.
 
B

Brad Pears

When you say latest service pack - do you mean win2K service pack (we are
already at SP4) or Office service pack? We are at SP-2 on both the win2k and
win2k3 terminal servers there... Should I move to SP-3??

Thanks,

Brad
 

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

Top