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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending email using MSOUTL9 library with Office SP3 causes error

Status
Not open for further replies.

gregoriw

Programmer
Sep 21, 2001
40
0
0
US
Hello all, Hope somebody can direct me to a solution with this error. I have a VB6 (sp5) program that references MSOUTL9.OLB so I can programmatically generate/send an email to the IT department in case an error occurs within the program. That way immediate errors can be fixed sooner. Here is that code...
===========================================
Public Sub DeliverEmail(ByVal strErrorMessage As String)
'NOTE: This routine prepares all necessary activity to send the error report to the recipient

Const strPROCNAME As String = "DeliverEmail"

Dim strTemp As String
Dim strErrMsg As String

Dim thisMessage As MailItem

On Error GoTo Err_Handler

'start MAPI assignments
10 Set mOutlookApp = New Outlook.Application
12 Set thisMessage = mOutlookApp.CreateItem(olMailItem)

'send memo with attachment
16 With thisMessage
'who gets this email?
20 .Recipients.Add mstrEmailSupport

'what's it all about?
24 .Subject = "Adverse Action Letter Program Incident Information"
strTemp = "An incident occurred in the AALetterGenerator program on " & Now() & vbCrLf
strTemp = strTemp & "---------------------------------------------------" & vbCrLf
strTemp = strTemp & strErrorMessage & vbCrLf
strTemp = strTemp & "---------------------------------------------------" & vbCrLf & vbCrLf
strTemp = strTemp & "Please investigate."

26 .Body = strTemp
'let her rip!
30 .Send
End With

DoEvents
32 Set mOutlookApp = Nothing
34 Set thisMessage = Nothing

Exit Sub

Err_Handler:
=======================================

This process has worked brilliantly in the past and kept IT on their toes for any error trapped within the program. No problems existed until a new PC that has the latest SP 3 security patch was used to run this same program (which hasn't been changed in a year) this week. The error occurs on line 20 in the routine above where it tries to insert/add an email address to the .Recipients.Add property.

The program error handler responds with the error - Application-defined or object-defined error. #287 on line 20.

The only apparent clue where this error came from appears to be that this one PC had the security patch 3 applied to it's MS Office 2000 system and the other PCs have not...and those PCs can run the program without error. BTW, the program is not run from the local PC drives but from a network folder, so this error should occur for all PCs if it was a program coded problem.

Do you know if there is an update to the MSOUTL9.OLB file that bypasses or works with the new SP 3 Office/Outlook update? Besides yanking out the code that creates/sends these emails from the program, do you know of another way VB6 can co-exist with the new SP 3 email security restrictions?


Thanks,
gregoriw
 
Hi
Check out

faq222-2392 Getting around Outlook Security Patch

Hope it helps.

Regards

Daren



Must think of a witty signature
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top