Outlook 2000 - Sending Email Problem

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
 
S

Sue Mosher [MVP-Outlook]

I've seen this error occur if the Recipient object is not resolved first.
So, try olRecipient.Resolve
 
F

Frank Ball

I have tried to resolve but the result (the error message) stays the same.
Unfortunately.

Frank Ball
 
S

Sue Mosher [MVP-Outlook]

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