IF loItem.Attachments.Count > 0 This.SaveAttachments( loItem ) ENDIF>Thank you. I will see how this code could be applied. BTW, what tool/code do you use to create the object toMsg?
>>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 >>>>