Question

Has anyone ever been able to strip the body out of an Outlook.msg file into a Memo field? I am seriously stuck here.

Was it helpful?

Solution

msgfile=getfile('msg')
o = CreateObject("Outlook.Application")
emailmsg = o.ActiveInspector.CurrentItem
memofiledvariable = emailmsg.body

The only caveat is you will need to give foxpro security access in Outlook. There are ways around this using Outlook Redemption or an automated clicking program.

OTHER TIPS

for i = 1 to nFilesFound xx = xx + 1 
    do above code here as you got it working in test
    insert into cmemails (cprimary, csubject, ddate, dtime, cattribs,mbody) values (generateGuid(26), MyFiles[ i, 1], MyFiles[ i, 3], MyFiles[ i, 4], MyFiles[ i, 5] ,memofieldvariable) 
endfor 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top