Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook to VFP Drag Drop What's Wrong with this?
Message
From
12/08/2005 11:15:48
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Outlook to VFP Drag Drop What's Wrong with this?
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01040563
Message ID:
01040563
Views:
127
I'm trying to allow users to drag drop an email message to a VFP Text Box control on a Form. It I enable
oledragMode=1
oledropMode=1
oleTextinsertMode=1
I can drag drop the header on the the textbox - no problem. Now how do I get the body of the email

Adding the code below to OleDragOverMode and OleDropMode works but there's a problem.
function OleDragOverMode()
Lparameters oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord, nState

If oDataObject.GetFormat( 1 )
	lc = oDataObject.GetData( 1)  && at this point, lc = outlook header.
	If "Subject"$Mline(lc,1) && test to see if drag drop is from Outlook
		lo = Createobject("outlook.application")   && access Outlook
		loX = lo.ActiveExplorer && get last Selected email 
		loItem = loX.Selection.Item(1) && get the body of the eamil 
		Thisform.cText = loItem.Body &&  Here's the work around, I've got the body of the email 
		&& But how to append it to header? - Adding it to the form works
		&& then adding the body when Drag Drop fires.
	Endif
Endif



Function OleDragDrop() 
LPARAMETERS oDataObject, nEffect, nButton, nShift, nXCoord, nYCoord
this.value = this.value +thisform.ctext && this will add the body of the email to the text box. However,
* the problem is: if the text box had data in it already and the users want to  prepend the email to the 
* beginning of the message, the Subject will correctly insert at the top, but the email will be added to the end(split up) 
*
Anybody know how I can append the body of the email to the header before the Drag Drop is completed.

TIA
Marty
Next
Reply
Map
View

Click here to load this message in the networking platform