Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error calling Outlook mail under WinXP SP2 (03)

    I have some code that has worked well under windows2000 and windowsXP-sp1 and
    Access 97, 2000, and 2002, and Outlook 2000 and 2002, and in every
    configuration of the above you could assemble. We are now going to WinXP-sp2
    and the code is not working - though I think it's related to sp2, I am not
    sure. The de###### hilights the last line here:

    Private Sub CbtnEmail_Click()
    On Error GoTo err_handle

    Dim strJob As String
    strJob = Me.Job_


    Dim doubStart As Double
    Dim intCount As Integer
    Dim fso As FileSystemObject
    Dim Subjectline As String
    Dim ToList As String
    Dim MyOutlook As Object 'Outlook.Application
    Dim db As DAO.Database
    Dim MailList As DAO.Recordset
    Dim MyMail As Outlook.MailItem
    Dim strTeam As String, strCust As String

    'grab the team this job belongs to and the customer
    strTeam = Me.Team
    strCust = Me.CustName

    Set fso = New FileSystemObject

    'Setup Subject line
    Subjectline$ = "New Job ... Number " & strJob

    'Now, we open Outlook for our own device..
    'Set MyOutlook = New Outlook.Application
    Set MyOutlook = CreateObject("Outlook.Application")
    ...

    Any Idea Why? I can't find any ref. to this error number on Microsoft.com

    Thanks

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

    Re: Error calling Outlook mail under WinXP SP2 (03)

    Apart from the incomplete instruction

    strJob = Me.Job_

    (there is a continuation character but no continuation line), there is nothing intrinsically wrong with the code. It would have been helpful if you had told us what the error number and/or message is.

  3. #3
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error calling Outlook mail under WinXP SP2 (03)

    the line could read:

    strJob = Me.[Job#]

    I know it's poor naming practice, but I did it years ago now...
    <font color=blue>
    Anyway the error reads like this:

    Run-time error '-2147024770 (8007007e)':

    Automation error
    The specified module could not be found. </font color=blue>

    when I go to debug, the last line (Set MyOutlook = CreateObject("Outlook.Application") is highlited, after which in my code I open a mail object and populate it (code at end). I notice that the error messege I recieve must be happening outside of Access, as it does not display the error Message box from my code. I have tested a couple other computers that have WinXP-sp2 now and they all give me the same error, WinXP-sp1 works fine.

    Thanks!

    <font color=blue>
    'Set up the database and query connections
    Set db = CurrentDb()
    Set MailList = db.OpenRecordset("TblContacts")

    'Loop through our list of addresses, adding them to e-mails
    'and sending them if the "FLAG" is set according to Team Membership
    Do Until MailList.EOF

    'Check the Team "Flag"
    If Not MailList(strTeam) Then GoTo EMailLoop

    'This addresses it
    ToList = ToList & MailList("email") & ";"

    'And on to the next one...
    EMailLoop:
    MailList.MoveNext

    Loop

    'This creates the e-mail
    Set MyMail = MyOutlook.createitem(olMailItem)

    'This addresses it
    MyMail.To = ToList

    'This gives it a subject
    Subjectline = "Please visit the Applications Database to view Job " _
    & "Number " & strJob & ", for " & strCust & ". It has changed."
    MyMail.Subject = Subjectline

    'This sends it!
    MyMail.display


    'Cleanup
    Set MyMail = Nothing


    err_handle_exit:
    Exit Sub

    err_handle:
    MsgBox Err.Description & " : FrmApplications error number: " & Err.Number
    Resume err_handle_exit

    End Sub</font color=blue>

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

    Re: Error calling Outlook mail under WinXP SP2 (03)

    The code does work for me (Windows XP Home SP2, Access 2002 SP3). Could you, as an experiment, switch back to early binding?

    ...
    Dim MyOutlook As Outlook.Application
    ...
    Set MyOutlook = New Outlook.Application
    ...

    Do you get the same error? If so, it would seem that there is a problem with the registration of Outlook. You might try Help | Detect and Repair in Outlook.

  5. #5
    Star Lounger
    Join Date
    Jul 2003
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error calling Outlook mail under WinXP SP2 (03)

    Yes i have tried that and i get the same error using early binding as with late. I have not tried detect and repair yet, because the pcs are all new Dell Optiplex's with Office and Windows pre-loaded, but I can try...

Posting Permissions

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