Need help dropping Outlook Attachment into my Application

J

Joseph Geretz

Our application allows the to drag files from the Windows shell and drop
them onto our application. We handle the drop via the OLEDragDrop event. In
this event we use the following check to ensure that we're getting one (or
more) file(s) dropped onto our control.

If Data.GetFormat(vbCFFiles) = True Then ...

If so, we proceed to process the files.

It was recently brought to my attention that dragging an e-mail attachment
does not process the attachment into our application. Sure enough, I stepped
through the code and discovered that Data.GetFormat(vbCFFiles) returns False
for an e-mail attachment. How can I process e-mail attachments as the source
for an OLEDragDrop operation?

Thanks for your help,

- Joe Geretz -
 
Y

YYZ

Joseph Geretz said:
Our application allows the to drag files from the Windows shell and drop
them onto our application. We handle the drop via the OLEDragDrop event.
In this event we use the following check to ensure that we're getting one
(or more) file(s) dropped onto our control.

If Data.GetFormat(vbCFFiles) = True Then ...

If so, we proceed to process the files.

It was recently brought to my attention that dragging an e-mail attachment
does not process the attachment into our application. Sure enough, I
stepped through the code and discovered that Data.GetFormat(vbCFFiles)
returns False for an e-mail attachment.

You sure about that? I couldn't try an email attachment in Outlook Express,
but I did find one from a newsgroup post. Here is the code that I have (new
project, add a listbox to the form and set it's OLEDropMode to Manual):

Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As
Integer, Shift As Integer, X As Single, Y As Single)
Debug.Print Data.GetFormat(vbCFFiles)
Debug.Print Data.Files.Item(1)
End Sub

When I run this, and drop an attachement on there from a newsgroup post, it
puts out this:

True
C:\Documents and Settings\Matt_D\Local Settings\Temporary Internet
Files\Content.IE5\89Y38XIF\SplashFade.zip

Like I said, I can't test email attachements because we aren't allowed pop
access here, but I would ASSUME that it would work the same way -- but
you'll have to test it.

Matt
 
J

Joseph Geretz

Hope the NG will forgive me for this small attachment. I'll test this out
from OE, let's see what I find. However, Outlook may be different than
Outlook Express. (MS seems to run out of product names so they reuse the
same name across multiple products ;-)

- Joe Geretz -
 
L

Lance Wynn

I found this article over at CodeGuru, but I don't have time to test it out.
Let me know if it helps.

http://www.codeguru.com/Cpp/I-N/internet/email/article.php/c3381/


Our application allows the to drag files from the Windows shell and drop
them onto our application. We handle the drop via the OLEDragDrop event. In
this event we use the following check to ensure that we're getting one (or
more) file(s) dropped onto our control.

If Data.GetFormat(vbCFFiles) = True Then ...

If so, we proceed to process the files.

It was recently brought to my attention that dragging an e-mail attachment
does not process the attachment into our application. Sure enough, I stepped
through the code and discovered that Data.GetFormat(vbCFFiles) returns False
for an e-mail attachment. How can I process e-mail attachments as the source
for an OLEDragDrop operation?

Thanks for your help,

- Joe Geretz -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top