Outlook 2000 - Sending Email Problem

  • Thread starter Thread starter Frank Ball
  • Start date Start date
F

Frank Ball

Hi,

I am using the following code snippet to create a
new mail message from within Microsoft Access 2000.
The problem occurs in the line marked with "XX"
As long as I leave the code as shown below
it runs perfectly. When I change this line to .send
I keep getting a runtime error (-2147417851 (80010105)
with every try.

I don't have too much experience with Outlook
programming and would like to know if there is
another approch (maybe a more professional one)
to sending mails ? Is there a hidden bug in my code ?
Can anyone give me a hint in the right direction or
correct my code ?


Frank ball

----------------------------------------------------
Dim olApp As Outlook.Application
Set olApp = Outlook.Application
Dim olMailMessage As Outlook.MailItem
Dim olaufgabe As Outlook.TaskItem
Dim olkontakt As Outlook.ContactItem
Dim olRecipient As Outlook.Recipient
Dim olattach As Outlook.Attachment
Dim blnKnownRecipient As Boolean


Set olMailMessage = olApp.CreateItem(olMailItem)
With olMailMessage
Set olRecipient = .Recipients.add(Empfänger)
.Subject = Betreff
.body = Textkörper
XX .Display True
End With
 
I've seen this error occur if the Recipient object is not resolved first.
So, try olRecipient.Resolve
 
I have tried to resolve but the result (the error message) stays the same.
Unfortunately.

Frank Ball
 
But did the name actually resolve?
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Hi,

I have tried to resolve the recipient but to no good. I keep getting
the same error.

Frank Ball
 
Hi,

yes it did resolve. However, this doesn't help.
When the message is diplayed and sent, everything works jsut fine
When I try to send the message in the background it still give the error.

Frank Ball
 
Try adding an On Error Resume Next statement. What build of Outlook 2000?
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top