Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drag and Drop email message from Outlook
Message
From
14/06/2006 03:44:03
 
 
To
13/06/2006 17:21:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01128623
Message ID:
01128907
Views:
25
This message has been marked as the solution to the initial question of the thread.
>>>I can drag & drop an email message from Outlook into Windows Explorer and it creates a .MSG file.
>>>
>>>How can I do that in Visual FoxPro? I want to drag & drop a message from Outlook to a VFP form when the .msg file would be placed into a specified directory (held as a form property).
>>>
>>>I can only seem to access the subject,contents, date and size of the dropped object.
>>>
>>
>>Take a look at http://www.codeproject.com/csharp/testemaildragdrop.asp?df=100&forumid=51309&select=1092474#xx1092474xx
>
>Sergey,
>Thanks for the pointer. I'm sure the answer is there, but I can't quite get it to work -
>
>
>=GETOBJECT("o", "Outlook.Application")
>FOR EACH i in o.ActiveExplorer.Selection()
>	i.SaveAs("c:\temp\test.msg")
>NEXT
>
>
>The FOR EACH line indicates a syntax error and I can't see what is wrong with it.
>
>I have tried having a single email item selected in Outlook and reducing the offending line of code to
>
>
>o.ActiveExplorer.Selection(1).SaveAs("c:\temp\test.msg")
>
>
>but then I get an OLE error: Parameter not optional.
>
>
>Any advice greatly welcomed!
>Thanks
>Barry Sutton


After Sergey's pointer,an hour or so of delving around in
the Outlook object model and a little trial and error
I've got it sorted. The following works:
myOlApp=CREATEOBJECT("Outlook.Application")

For n = 1 TO myOLApp.ActiveExplorer.Selection.count()
	=myOLApp.ActiveExplorer.Selection.item(n).SaveAs("c:\temp\test_"+ALLTRIM(STR(n))+".msg")
endfor
Previous
Reply
Map
View

Click here to load this message in the networking platform