Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending e-mail function

Status
Not open for further replies.

RobPotts

Technical User
Aug 5, 2002
232
US
Hi,

I've got the following code

Code:
Dim appOutLook As Outlook.Application
    Dim MailOutLook As Outlook.MailItem
    Set appOutLook = CreateObject("Outlook.Application")
    Set MailOutLook = appOutLook.CreateItem(olMailItem)

        With MailOutLook
            .To = "xxx"
            .Subject = "xxx"
            .HTMLBody = "xxx"
            .Attachments.Add "C:\Temp\xxx.snp", olByValue, 1, "xxx_SNP"
            .Attachments.Add "C:\Temp\xxx.RTF", olByValue, 1, "xxx_RTF"
            .Send
        End With[code]

Which works fine on my pc.  However when I try and use it on another pc I get

Run-time error '-1283440635 (b3804005)'
Outlook does not recognise one or more name

VB then Highlights the .Send

What can I do to change this.  I noticed the other computer has reference to Microsoft outlook 9.0 object type library, whereas mine has Outlook 98 object type library.  The other pc doesn't have this as an option.  Is this the problem and either way how to I get round this.

Thanks in advance Rob! [Bigcheeks]
Process and Procedure are the last hiding place of people without the wit 
  and wisdom to do their job properly.
 
Hi,

Are you using the actual e-mail address where you have
Code:
.To = "xxx"
, or just a name? If you are, try changing it & see if it makes a difference. Although the
Code:
.send
is highlighted, I think that's because it doesn't check the address before that point.

Sharon
 
Witch version of Access are you using?
And witch versions of outlook are installed on the PC's? I think it's a problem with the different versions of outlook, that the oldest doens't recognise one or more commands.

greetz

Tom
 
I tried that code, replacing the "xxx" in the .To parameter with a valid e-mail address and it worked, so it seems that this code will work only if we send valid addresses.
But I'm stuck here too. How do we get this to check in the Outlook address book, or at least, to open the unsent message and letting us check the email address?
 
I don't know any details, but I think you can use
Code:
.Resolve
to check addresses, may be something in help.

Sharon
 
Hi,

Insted of the

.send

Use
.Display

This rectified my problem

Rob! Rob! [Bigcheeks]
Process and Procedure are the last hiding place of people without the wit
and wisdom to do their job properly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top