FUNCTION SaveAttachments( toMsg ) LOCAL loAttachment, lcFileName *** Saves the attachments associated with the current message to the specified file name FOR EACH loAttachment IN toMsg.Attachments * send attachment files into a subdir * append "ATTACH\" lcFileName = FULLPATH( CURDIR() + this.cDirAttach ) + loAttachment.FileName if !empty( m.lcFileName ) loAttachment.SaveAsFile( lcFileName ) *** Make sure it was saved *** The SaveAsFile method returns null...it doesn't tell us about success or failure IF FILE( lcFileName ) *** ok...now add it to the table INSERT INTO SaveAttach ( omMailFK, attFname ) VALUES ( SaveMail.omMailPK, lcFileName ) ENDIF endif ENDFOR ENDFUNC>Hi,