Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

file drag and drop capabilities?

Does anyone know if it is possible to drag and drop files into an OpenInsight control?

Here is the hypothetical situation. I would like to capture email correspondence concerning a sales order between a buyer and our salesperson. Could OI be programmed to accept a message dragged from Outlook?

When I drag a message from Outlook to My Documents, Windows creates an .MSG file. The file seems to be independent of the user's Exchange mailbox. It's a standalone message file and requires no connection to Exchange Server to view (I think). I'd love to be able to do that inside OI. I want the user to be able to drag and drop a message into the order itself and then it becomes part of the record.

Any ideas on whether or not this is possible?

Comments

  • Harold,

    OpenInsight has limited support for drag-and-drop. It can support drag-and-drop of information between controls and drag-and-drop from OS files. You cannot drag-and-drop directly from Outlook.

    If you drag an email into a folder, you can drag the .MSG file onto an OpenInsight control. This will pass into the event handler a path to the .MSG file. Then it is up to you to do decide what you want to do. Presumably you would open the file, read the content, and store it in OI.

    Note that .MSG files have a lot of encoding and unless there is a lot of plaint text, it will be difficult for you to parse. This is probably more than you care to dive into, but the formatting for .MSG files can be found at this link:

    Outlook Item (.msg) File Format
  • I don't need to unencode the files but it would be helpful to have the subject available and maybe the sender. Mainly I want the messages to be available with a double-click via a an edit table on the sales order form. I should be able to program OI to call the Utility subroutine or whatever to launch the file that has the MSG extension. That part is easy.

    Will the file drag pass the file name to the event handler?

    The overall process needs to be made easy for the end user, or they won't use it. I am not sure how to make the initial drag to a folder easy. They would have to drag the message to a customer folder where the folder name was the customer ID or something like that. That process would be harder than dragging it to a customer folder in their inbox, which is what they are doing now. I guess I could force Windows to display the correct customer folder in Windows Explorer. Maybe program a button in OI (on the sales order form) to launch Explorer and open the correct customer folder. That might do the trick.
  • Harold,

    If you intend to keep the .MSG file on the disk, then you can certainly execute the file and allow the default viewer (presumably Outlook) to open the file. I recommend using the ShellExecute API, assuming it will work. I think it will be a better experience than using Utility.

    Yes, I tried to explain that the file drag will pass the file name (along with the full path) into the event handler.

    Your concerns about this being difficult (or complex) enough to discourage people from using it is definitely valid. I am not sure I read anything in your last paragraph that will ease this problem significantly. The only other option I might suggest is to find a way to support Outlook as a drag source. Our SRP Picture ActiveX control supports the normal file based drag-and-drop, but we might be able to enhance it to support Outlook. We would need to treat this as a project. If that interests you then drop me an email to discuss further.
Sign In or Register to comment.