LeoLems


Hi everyone,

I am hoping someone can help me with this one...

I am looking for a way to save a dropped MS Outlook email message to a .msg file

The drop will be on a visual foxpro control (doesn't matter wich one)

I just want the .msg file and nothing else.. But I want it in a drag & drop kind of style.

It is similair to a drop of a email message on the desktop (this will come out as an .msg file)

greetings,

Leo





Re: Drop MS Outlook emails on a foxpro control and save it to a .msg ??

Stuart Dunkeld


Hi

You can cheat, and get Outlook to do it itself: in the OLEDragDrop event of your form, have code like this:

lparameters oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord

if oDataObject.getformat("FileGroupDescriptor")
* It's an outlook item.

oOutlook = createobject("outlook.application")
oItems = oOutlook.ActiveExplorer.selection
for nLoop = 1 to oItems.count
oMailItem = oItems.item(nLoop)
oMailItem.saveas ("c:\temp\foo" + transform(nLoop) + ".msg")
next

endif

This creates a new problem that Outlook needs authorisation to access emails. You can get round this by using a product like Outlook Redemption - http://www.dimastr.com/redemption/ - which has methods to import MSG files and do Extended MAPI queries which may well allow you to manipulate the dropped DataObject itself.





Re: Drop MS Outlook emails on a foxpro control and save it to a .msg ??

LeoLems

Hi Stuart,

It is better to cheat, than to have no solution at all...

I wil try your suggestion.. ( It will work I think, i saw this one somewhere else *** well)

The authorisation gives me no problems... I have that one coveredwith a component

that I have bought a while ago...

If anyone has an other good suggestion I am open for new suggestions...

Thnx,

Leo

-----------------

Edit:

It worked perfectly...

You can see what there was dropped by using the oMailItem.Class

43=Email, 26=Calender, 40=Contact, 48=Task

This info can help some more people I hope...







Re: Drop MS Outlook emails on a foxpro control and save it to a .msg ??