LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Drag and Drop Attachment from Outlook to LABVIEW

Hi,

 

I try to write a very simple program, which manages files. With the path control of LABVIEW we fortunately can Drag and Drop files from e.g. explorer, whose path I can use after dropping. The problem is, that I would like to do this directly with files from an Outlook mail attachment. Drag the attachment and drop it onto my LABVIEW window and be able to handle this file (copy elsewhere and rename it, for example)... That is what I dream of.

I searched the internet for a long time, but I didn't find a solution.

 

Thanks a lot for your help,

yours,

Daniel

 

0 Kudos
Message 1 of 7
(3,295 Views)

Hey Daniel,

 

There is a simple example I found on the LV-community:

 

https://decibel.ni.com/content/docs/DOC-9191

 

I tried to drag a text-file directly from the Mail-Inbox and droped it to the DragDrop.vi and it worked.

 

What do you think?

 

Best regards

 

Joachim

0 Kudos
Message 2 of 7
(3,223 Views)

Hi Joachim,

 

thanks for your reply!

I already tried, but tried again the procedure you described. Unfortunately, it doesn't work at my computer. The example is using a path-control, which is able to handle Drag&Drop for files you select from Windows explorer for example. Dragging attachments from Outlook seem to be handled different from windows. I was thinking, that maybe it has to do with the fact, that the Outlook attachments do not exist as (individual) files on the hard disk but in some kind of Outlook data file (one big file for all eMails). So, as I am not an expert, I would expect, that I have to open a "stream" and then hanlde data or something like this. I also checked the internet about dll-files, that might help me, but I didn't succeed.

What kind of Mail-Inbox do you use? Outlook? Did you save the file in advance?

 

Thanks a lot,

yours,

Daniel

0 Kudos
Message 3 of 7
(3,198 Views)

Hi Daniel,

 

No, we use IBM Lotus Notes. And no, i didn't save it in advance.

But it works with Lotus. Maybe it's an attitude thing with Outlook.

 

Best regards

 

Joachim.

0 Kudos
Message 4 of 7
(3,144 Views)

Hi Joachim,

 

that's a good information, to know that it works with Lotus Notes. Thanks!

Anyway, I hope I get it to work with Outlook as well.

 

Yours,

Daniel

0 Kudos
Message 5 of 7
(3,134 Views)

Probably not as easily. Drag & Drop in Windows is a complicated thing with the Server and Client negotiating a format to transfer. The server can offer many formats and the client then selects the one it can handle. The LabVIEW path control only can handle physical paths. So if the server application offers a path as one of the formats and then when the application selects that format makes sure that the file is copied somewhere in the filesystem (temporary path) and sends that path to the client, the LabVIEW path control will work fine. If the server application insists into memory stream only formats, the LabVIEW path control can not deal with them in any way. Outlook being a Microsoft product most likely insists in OLE formats and then you get into trouble.

You basically need to interface to the Win32 or OLE Drag and Drop API to get this working. And no it's not trivial at all, because Drag and Drop not only varies greatly between platforms but also between OS versions.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 7
(3,125 Views)

I am aware that this thread is old, but I am having the same issue so am hoping someone has something new to share since the last post as I've been unable to find any other information anywhere. I would like to be able drag an attachment from outlook and drop it into a vi (which will then save the attachment in a predefined location).

Thanks in advance,

Alex

0 Kudos
Message 7 of 7
(2,123 Views)