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

duplicating email attachments

Status
Not open for further replies.

tractorvix

Technical User
Jun 29, 2004
122
GB
I have an email automated with 2 attachments. I also have an error handler that will skip records with invalid email addresses and move onto the next record. However, when it sends the next email the attachments are duplicated.

I currently have

errorhandler:
Select Case Err.Description

Case "Outlook does not recognize one or more names. "


Set MailOutLook = Nothing
Set appOutLook = Nothing
MailUser = ""
msgSubject = ""
msgbody = ""
rst.Edit
rst.Comments = "Cannot send with Personnel Number"
rst.Update

Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)

Resume 10

and assumed that by setting the appoutlook to nothing it would remove them before continuing with the loop, but it doesn't seem to be happening.

Anyone any ideas?

Vix
 
Perhaps this ?
Set MailOutLook = Nothing
appOutLook.Quit
Set appOutLook = Nothing

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top