09-29-2010, 09:01 PM
Function Function4
Not knowing exactly what format the .eml file is submitted by the form may cause problems.
Dir d
str Data
foreach(d "$Desktop$\entries\*.eml" FE_Dir)
,str Entry=""
,str sPath=d.FileName(1)
,MailBee.Message m._create
,m.ImportFromFile(_s.expandpath(sPath))
,str body=m.BodyText
,body.trim
,for int'i 0 numlines(body)
,,str linetext.getl(body i)
,,str split=": "
,,_i=find(linetext split)+split.len
,,_s.get(linetext 0 _i)
,,sel _s
,,,case ["First: ","Last: ","Phone: ","Email: ","Address: ","City: ","State: ","Zip: "]
,,,Entry.addline(F"{_s.get(linetext _i)}")
,Entry.findreplace("[]" ",")
,Data.addline(Entry)
str CSVfile="$Desktop$\entries\Data.csv"
CSVfile.expandpath
Data.setfile(CSVfile)
run "EXCEL.EXE" F"''{CSVfile}''"