with this.cntMAPI > > .Fetch() && Get the messages in the Inbox to the read buffer > > .GetMessage() && get first message > > for i = 1 to .mnMsgCount > if ( at( "AGE.", .MsgSubject ) = 1 ) > .GetAttachment() > * message to process > thisform.Refresh() && update the display > > llProcessed = .f. > do case > > case ( at( EMAIL_TYPE_CODES, .MsgSubject ) > 0 ) > llProcessed = this.ImportCodes() > > endcase > if ( llProcessed ) > .DeleteMessage() > endif > endif > .GetNextMessage() && iterate to next message > endfor > >* ImportCodes() method >if ( this.cntMAPI.mnAttachmentCount != 6 ) > MessageBox( "Unexpected number of attached files", MB_OK, _screen.Caption ) > this.ctnMAPI.txtStatus.Value = "Import Terminated" > return .f. >endif > >this.txtImportType.Value = EMAIL_DESCR_CODES >*this.Refresh() > >local lcBackupDir > >lcBackupDir = ".\Backup\" + dtos( date() ) > >this.ImportFile( "codes.dbf" ) >this.ImportFile( "codes.cdx" ) >this.ImportFile( "codeclass.dbf" ) >this.ImportFile( "codeclass.cdx" ) >this.ImportFile( "codeapplies.dbf" ) >this.ImportFile( "codeapplies.cdx" ) > >this.cntMAPI.txtStatus.Value = "Successful Import" > >* ImportFile() method >lparameter pcFileName > >this.cntMAPI.txtStatus.Value = "Importing " + pcFileName > >local lcInFile > >lcInFile = sys(2023) + "\" + pcFileName >if ( file( lcInFile ) ) > copy file (lcInFile) to (pcFileName) >else > ErrorLog( "Can't find file:" + lcInFile + " " + pcFileName ) && 28-Apr-98 > MessageBox( "Can't find file:" + lcInFile, MB_ICONEXCLAMATION, _screen.Caption ) >endif>