Jason For what its worth
procedure TViewHistoryForm.AddAttachment1Click(Sender: TObject); var Coded: TMimeMess; TopPart: TMimePart; Cntr: integer; attList: TStringList; sr: TSearchRec; begin if OpenDialog1.Execute then begin if (ELN.State in dsEditModes) or GetRecordLock(ELN) then begin editOrInsert(EditItem); ELN_Encoding.AsString := etMime; Coded := TmimeMess.Create; TopPart := Coded.AddPartMultipart('mixed', nil); if not ELN_Encoded.IsNull then begin Coded.Lines.Assign(ELN_Encoded); Coded.DecodeMessage; end; attList := TStringList.Create; attList.Assign(ELN_aList); for Cntr := 0 to OpenDialog1.Files.Count - 1 do begin if FindFirst(OpenDialog1.Files[Cntr], faAnyFile, sr) = 0 then begin Coded.AddPartBinaryFromFile(OpenDialog1.Files[Cntr], TopPart); attList.Add(ExtractFileName(OpenDialog1.Files[Cntr]) + FldSep + BytesToKbMb(sr.Size)); end else nlhMessageDlg('Unable to find the desired file', mtError, [mbOK], 0); FindClose(sr); end; Coded.EncodeMessage; ELN_Encoded.Assign(Coded.Lines); ELN_aList.Assign(attList); Coded.Free; attList.Free; end else nlhMessageDlg('Unable to lock the record.', mtError, [mbOK], 0); end; end; Roy Lambert ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ synalist-public mailing list synalist-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/synalist-public