• creating email message vs Outlook 2000 (sp1) (Access 97 )

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » creating email message vs Outlook 2000 (sp1) (Access 97 )

    Author
    Topic
    #385675

    I’m using the following code to embed a word document into the body of an email, then send the email to the intended party (names have been changed accordingly). The problem is that the new service pack for Outlook 2000, in its attempt to circumvent “bad” attachments, is not happy with what we’re trying to do, and this ends up in the ultimate loop ‘o doom as the user tries to click the “yes” button when the explanatory “are you sure you want to send this attachment because some attachments can contain viruses” window pops up over and over and over again, until the user ctrl/alt/dels the whole process, which ends up eventually corrupting the database.

    Here’s the innocent code:

    tempFilePath = CurDir
    tempFilePath = tempFilePath & “” & “Temp.txt”
    DoCmd.OpenReport “R_FcstDiff”, acViewPreview

    DoCmd.OutputTo acOutputReport, “R_MickeyDiff”, acFormatTXT, tempFilePath
    DoCmd.Close acReport, “R_MickeyDiff”
    fnum = FreeFile()
    ‘opens temporary .txt file, and inputs into the body of the email
    Open tempFilePath For Input As fnum
    FileContents = Input$(LOF(fnum), fnum)
    Close #fnum
    ‘set the mailrecip string (called Recipient in the sub)
    ‘this opens outlook for those of us who forget all the time
    If isAppRunning(“outlook.application”) = False Then
    Shell (“outlook.exe”)
    Else
    End If
    ‘heres where it creates the email
    MailRecip = “minniemouse@imtrying.organza”
    MailCC1 = DLookup(“mailname”, “tblUser”, “user ” & “””” & ” ” & “”””) & “@imtrying.organza”
    MailCC2 = ” ”
    MailSubj = “Adjusted Item for ” & Me.PLine
    bpurge = True ‘this will prevent the message from being saved in the sent items
    ‘ should be set to false if copy needs to be saved
    bpreview = False ‘ this will send the message instead of displaying it and waiting for you to send it
    ‘sends out email
    Call SendMail(MailSubj, FileContents, MailRecip, MailCC1, MailCC2, bpreview, bpurge)
    ‘deletes .txt file
    Kill tempFilePath

    I think the irritating Outlook situation is occurring when the Sendmail is called.

    Does anyone have any suggestions, other than uninstalling this service pack?

    The sysadm is sort of peeved at me. bwaaah

    Viewing 0 reply threads
    Author
    Replies
    • #666092

      Get the Redemption dll. It uses Extended MAPI to get around the so-called “draconic Outlook security update”.

      • #666097

        smile joy smile joy

        Sysadm is looking into this and they got all excited.

        Thanks, Hans! thankyou

        • #666298

          Just a caution on Redemption. It works just fine with Access 97, but you must have the CDO library installed on the machine or Redemption breaks. Outlook doesn’t necessary install CDO by default, so you may have to do a reinstall on a given machine to get the functionality you need, depending on the OS you’re using.

          • #666353

            Thanks, Charlotte – I’ll let the sysadm know. As far as I can tell, I have the correct version on my machine, but then again, being the developer, it never happens here… shrug

            • #666358

              The problem is more likely on machines running NT, Win2k or WinXP, which don’t automatically installl CDO.dll. Later versions of Outlook only install CDO.dll if you do a custom install and drill into the Outlook options to specifically select it.

    Viewing 0 reply threads
    Reply To: creating email message vs Outlook 2000 (sp1) (Access 97 )

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: