Results 1 to 5 of 5

Thread: Automating Outlook - Error 429 (Activex cannot create object)

  1. #1

    Thread Starter
    Hyperactive Member tpfkanep's Avatar
    Join Date
    Jun 2002
    Location
    South Africa
    Posts
    272

    Automating Outlook - Error 429 (Activex cannot create object)

    Hi,

    I have the following code:
    VB Code:
    1. Dim olapp As New Outlook.Application
    2. Dim olMail As Outlook.MailItem
    3.  
    4. Set olMail = olapp.CreateItem(olMailItem)
    5.  
    6. olMail.To = txtEmail.Text
    7. olMail.Subject = "Blah..."
    8. olMail.send

    It works on my machine (with Outlook 2002), but when I install it on the user's PC (with Outlook 2000) I get "Activex cannot create object".

    I used P+D wizard to create the setup files, and I checked the MSOUTL.OLB file on the users PC - it has the same attrib. as on my PC.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    is it the same versionOLB file?

  3. #3
    Addicted Member DJ_Catboy's Avatar
    Join Date
    Jan 2003
    Location
    Suffolk, UK
    Posts
    159
    Hi,

    Try using CDO. Code as below:

    Code:
    Dim newMail
    
    Set newMail = CreateObject("CDONTS.Newmail")
    newMail.To = "[email protected]"
    newMail.body = "body message"
    newMail.send
    set newMail = nothing
    It works much faster and also doesn't depend on having Outlook installed. Also, you can send cheeky e-mails from any e-mail addres on your current domain (i.e. [email protected]) by saying newMail.From.

    Hope this helps?

    DJ

  4. #4

    Thread Starter
    Hyperactive Member tpfkanep's Avatar
    Join Date
    Jun 2002
    Location
    South Africa
    Posts
    272
    Thanx for the replies.

    Originally posted by kleinma
    is it the same versionOLB file?
    How do i check the version?

    Originally posted by DJ_Catboy
    Hi,

    Try using CDO. Code as below:

    Code:
    Dim newMail
    
    Set newMail = CreateObject("CDONTS.Newmail")
    newMail.To = "[email protected]"
    newMail.body = "body message"
    newMail.send
    set newMail = nothing
    DJ
    This still give the "Activex cannot create object" error on newMail.Send.

    I selected ref. "MS CDO for NTS 1.2 Library"; "MS CDO for Exchange 2000 Library" and "MS CDO 1.21 Library" on 3 different occasions and on all 3 occasions the pgm failed on newMail.Send.

  5. #5
    Addicted Member DJ_Catboy's Avatar
    Join Date
    Jan 2003
    Location
    Suffolk, UK
    Posts
    159
    Hi,

    To be honest, I am not sure. Every time I have wanted to use this it just works! I copied the code in my previous post from a VBScript file that I have on one of my servers that runs an automated task!

    Apologies if I cannot be more helpful...

    DJ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width