Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Open Email and Copy Data from form submitted online
#2
Function Function4
Code:
Copy      Help
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}''"
Not knowing exactly what format the .eml file is submitted by the form may cause problems.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)