Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Outlook Express (Access 97 SR2)

    I have used the below code to create an send an email item from a module in access 97, however, this was for Outlook 2000 & 97, I now need to make the application work for outlook express. Can anyone tell me any tips on the method to send emails in outlook express. When running the below with the outlook express reference ticked, it crashes when it first gets to Outlook.Application as this command is only available through the outlook reference. Im guessing there must be a similar command for express?

    Dim ol As New Outlook.Application
    Dim ns As Outlook.NameSpace
    Dim newMail As Outlook.MailItem
    Set ns = ol.GetNamespace("MAPI")
    Set newMail = ol.CreateItem(olMailItem)
    With newMail
    .Subject = "Data from Phil"
    With .Recipients.Add(Email)
    .Type = olTo
    End With

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Outlook Express (Access 97 SR2)

    Unfortunately, Outlook Express doesn't have an exposed object model, so it can't be programmed in VBA (AFAIK).

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook Express (Access 97 SR2)

    Thanks Hans,

    Learn something every day! Guess ill have to write a routine for the user to save the file somewhere where they can then email it manually.
    Regards,
    Phil

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Outlook Express (Access 97 SR2)

    Have you exhausted the capabilities of DoCmd.SendObject? I think it uses the machines "default" e-mail program, which would compensate for the inability to talk to Outlook Express more intimately.

  5. #5
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook Express (Access 97 SR2)

    Sorry for the delay in replying, I was put onto another project, Im sure you all know how that is!

    I wasnt using docmd.sendobject as I was sending a compressed file, however, I have now set up the database to use docmd.sendobject if no other email client is available, therefore the user will have to make sure the number of records isnt too great - but if it comes to it I can write some code to check that.

    The only problem i've had with docmd.sendobject so far is on the first machine I tested it on. It had Outlook 2000 but I got the error: "You do not have a default email program selected, please make you're email program the default before running this"
    Or something like that anyway. However, outlook did not prompt me to make it the default and I dont know how to set it within outlook, any ideas would be much appreciated.

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Outlook Express (Access 97 SR2)

    Internet Explorer installs Outlook Express, whether you use it or not. Office normally installs Outlook. You have to pick one as your default email program, otherwise having it on the machine isn't enough. In IE, Select Tools-->Internet Options or select Internet Options directly in the Control Panel. Click on the Programs tab and specify the email program. SendObject won't work with OE.
    Charlotte

  7. #7
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    Gillingham, Kent, England
    Posts
    511
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Outlook Express (Access 97 SR2)

    Thanks Charlotte,

    I formatted recently and im so used to my home pc (win 98) which set the default email automatically, for some reason my work pc (win NT) didnt set the default when I installed Outlook 2000. Hence I didnt know where to set it manually.

    Thanks again.

Posting Permissions

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