Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Interop / November 2003

Tip: Looking for answers? Try searching our database.

Drag and drop of emails from outlook to my C# application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Johann Wagner - 20 Nov 2003 08:55 GMT
Hello!

I want to drop an email in my C# application. I get the drop event and the
dataobject. But i cannot interpret the data in the dataobject. So i cannot
get the email. I have found a code sample for getting appendix via
drag&drop, but this doesn't work for the email, too. Can somebody give me a
tip how i can get the email?

Regards,
Johann
Dmitry Streblechenko - 21 Nov 2003 16:44 GMT
Unless you are using Extended MAPI, there is no way to do that - besides a
couple of internal formats, drag data contains messages in the MSG format.
Or, since a user must select the messages in Outlook first to drag them,
simply query Application.ActiveExplorer.Selection collection.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

> Hello!
>
[quoted text clipped - 6 lines]
> Regards,
> Johann
Johann Wagner - 24 Nov 2003 08:55 GMT
Hello Dmitry,

thank you for your help! I can get the actual selection as you described.

But you wrote that the drag data contains messages in MSG format. Can i get
the messages and save them to .msg files?
The FileContents Data is null so i think it must be the RenPrivateMessages.
Is that right? Can i separate the msg files from there?
Do you know how i can do that?

Johann

> Unless you are using Extended MAPI, there is no way to do that - besides a
> couple of internal formats, drag data contains messages in the MSG format.
[quoted text clipped - 17 lines]
> > Regards,
> > Johann
Dmitry Streblechenko - 25 Nov 2003 00:10 GMT
You need to use the CF_HDROP format and DragQueryFile() to access the
temporary file names.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

> Hello Dmitry,
>
[quoted text clipped - 32 lines]
> > > Regards,
> > > Johann
Johann Wagner - 26 Nov 2003 09:28 GMT
Hello Dmitry,

i use CSharp, so i cannot use DragQueryFile(). The format CF_HDROP is not
available, too.

The formats available are:

RenPrivateSourceFolder
RenPrivateMessages
FileGroupDescriptor
FileContents
Object Descriptor
System.String
UnicodeText
Text

The first 3 are MemoryStreams which i cannot interpret.
The FileContents is always null.
Object Descriptor is MemoryStream which i cannot interpret, too
Others are strings with the mail subject.

Do you know how i can access it in CSharp?

Johann
Dmitry Streblechenko - 27 Nov 2003 21:38 GMT
I have no idea, but I would imagine that you can access Windows API
functions from C#.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

> Hello Dmitry,
>
[quoted text clipped - 20 lines]
>
> Johann
Johann Wagner - 28 Nov 2003 12:58 GMT
Thanks for your help!

> I have no idea, but I would imagine that you can access Windows API
> functions from C#.
[quoted text clipped - 28 lines]
> >
> > Johann
Matthew Chestnut - 25 Nov 2003 13:51 GMT
FYI, this ClipSpy tool is useful for seeing what's on the clipboard
(used by drag-n-drop):

http://home.inreach.com/mdunn/code/ClipSpy/clipspy.html

>Hello Dmitry,
>
[quoted text clipped - 7 lines]
>
>Johann
Johann Wagner - 26 Nov 2003 09:29 GMT
Thanks for the tool, but i didn't get the dragdrop data from clipboard.
Maybe it depends on that i am using CSharp and the .NET Framework.

> FYI, this ClipSpy tool is useful for seeing what's on the clipboard
> (used by drag-n-drop):
[quoted text clipped - 12 lines]
> >
> >Johann
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.