Dropmaster from delphi to Outlook

Support forum for our inter-application drag-n-drop components.

Dropmaster from delphi to Outlook

Postby ebodieben » Wed Feb 26, 2014 9:43 am

Hi

I am trying to drop files from my delphi client to an outlook email.
From windows I can drop anywhere and the attachment block is shown and the attachment is added.
From my delphi client i can only drop into the attachment block which is not visible at default.
I am getting a drop icon when i am hovering over the message block but the attachment is not added when dropped. :shock:
Any suggestions?

Best whishes
Ebo
ebodieben
 
Posts: 4
Joined:
Wed Feb 26, 2014 9:37 am

Re: Dropmaster from delphi to Outlook

Postby DropMaster » Wed Feb 26, 2014 10:25 am

Depends on what formats you're offering in your drag data object vs what Windows offers. Try this - build the FormatViewer application in Demos\Delphi\FormatViewer and drag into it instead of into Outlook from both Windows and your application, and see what's different. You may need to provide e.g. the Shell ID list array format also.
_________________________
DropMaster Support
DropMaster
 
Posts: 23
Joined:
Fri Apr 15, 2011 6:32 am

Re: Dropmaster from delphi to Outlook

Postby ebodieben » Thu Feb 27, 2014 7:14 am

:(
Not getting it working. But i found you're post about FileContents2 and i tried that one..
That has the same problem.
I can drag to the attachment block but not to the message block

I have been hacking in the code and my head is spinning :shock:
This is some complex code :)
ebodieben
 
Posts: 4
Joined:
Wed Feb 26, 2014 9:37 am

Re: Dropmaster from delphi to Outlook

Postby DropMaster » Thu Feb 27, 2014 9:57 am

Let's have a look at the code for your drop source, i.e. where you advertise the formats you'll provide, and populate them.
_________________________
DropMaster Support
DropMaster
 
Posts: 23
Joined:
Fri Apr 15, 2011 6:32 am

Re: Dropmaster from delphi to Outlook

Postby ebodieben » Mon Mar 03, 2014 7:34 am

Hi

Back from very short holiday!

Im not sure what you mean.
This is the source for the dropsource.

One of the problems is that when i am dragging a file the file is not necessarily on the machine. The files are in a grid and are downloaded when needed.

There are 2 options.
1. I'm dragging the file in my own app from one place to an other. Then the files don't need to be downloaded
2. I''m dragging to Desktop or Outlook. Then the need to be downloaded when i drop!

With the demo app FileContents2 i can drop on the desktop and i can drop in the outlook attchment block. BUT not in the message block. When i drop from Windows desktop to the Outlook mesage blokc the attachment is automaticly put in the attchment block.

Does my rambling make any sense?

DROPSDOURCE CODE
======================================
// First clear the format data...
FDropSource.CustomFormatData.Clear;
FDropSource.CustomFormatData.AddFormat(gvDropMasterStr[dsDocumentID] , ASelectedList.CommaText);

// A file group descriptor, so we'll find out about the file
// names dropped. Use a blank string so we'll get asked for these
// at drop-time.
FDropSource.CustomFormatData.AddFormat(DMFileGroupDescriptorFormatName, '');

// The file contents for each file we might be asked to fill in. Use
// a blank string for each so we'll get asked at drop time.
for j := 1 to ASelectedList.Count do
begin
FDropSource.CustomFormatData.AddFormatEx('FileContents', '', TYMED_HGLOBAL, j-1);
// Make sure we don't get a trailing null.
// Items[Count-1] is the TCustomFormatData we just added.
FDropSource.CustomFormatData.Items[FDropSource.CustomFormatData.Count-1].AllowTrailingNull := false;
end;


// A file group descriptor, so we'll find out about the file
// names dropped. Use a blank string so we'll get asked for these
// at drop-time.
// FDropSource.CustomFormatData.AddFormat(DMFileGroupDescriptorFormatName, '');


// Drag the "Shell IDList Array" format to get file linking capabilities
// Needs CF_HDROP (=15, see below) to be present too for move/copy
FDropSource.CustomFormatData.addFormat('Shell IDList Array', ShellIDListFromSelectedFiles);

// Drag FileGroupDescriptor
FDropSource.CustomFormatData.addFormat('FileGroupDescriptor',
FileGroupDescriptorFromSelectedFiles);
// Drag the CF_HDROP (=15) format to get file copying and moving.
FDropSource.CustomFormatData.addFormat(IntToStr(CF_HDROP), HDropFromSelectedFiles);
ebodieben
 
Posts: 4
Joined:
Wed Feb 26, 2014 9:37 am

Re: Dropmaster from delphi to Outlook

Postby DropMaster » Thu Mar 06, 2014 4:59 pm

Can you try using 'FileGroupDescriptor' or 'FileGroupDescriptorW' instead of the call to DMFIleGroupDescriptorFormatName?
_________________________
DropMaster Support
DropMaster
 
Posts: 23
Joined:
Fri Apr 15, 2011 6:32 am

Re: Dropmaster from delphi to Outlook

Postby ebodieben » Wed Mar 12, 2014 5:49 pm

Strange.. my post disappeared

I mentioned that the demo supplied with Dropmaster has same error

...\DropMaster\Demos\FileContents\FileContents2.dpr

My situation is the same. The file does not exists on start drag.
It is created on drop with (AnsiCompareText(formatName, 'FileContents') = 0)

This works in Explorer and in the attachment block in Outlook . But dropping the attachment in the body fails to add it to the attachment block. Problem is that the attachment blovk is only shown when the first attachment is added.

Dropping the file from explorer works fine.
ebodieben
 
Posts: 4
Joined:
Wed Feb 26, 2014 9:37 am

Re: Dropmaster from delphi to Outlook

Postby DashDeveloper » Wed Apr 30, 2014 10:22 am

I would like to find a solution to this problem as well.

Using the FileContentsTest Demo, I can drag from the Demo to an outlook message and create the file in the "Attached" prompt area, however dropping on the message body does not work. This behavior is inconsistent with user expectations and the work-around is clumsy at best.

Does anyone have any thought on what to try next?
DashDeveloper
 
Posts: 1
Joined:
Mon Apr 28, 2014 4:22 pm

Re: Dropmaster from delphi to Outlook

Postby DropMaster » Mon May 12, 2014 12:33 pm

This would seem to be some kind of Outlook issue - it's obviously looking for something different in the dropped data. The best thing you can do is to drag from both sources (your application, and Explorer) into FormatViewer (an example application that ships with DM) and compare them.

Does this work from Delphi if you drop actual files rather than the FileContents format? The FileContents stuff is so you can drop dynamically created "just-in-time" content, but you could be dropping an actual file in many situations. And when dropping from Explorer you're dropping an actual file, so these are actually two different scenarios.
_________________________
DropMaster Support
DropMaster
 
Posts: 23
Joined:
Fri Apr 15, 2011 6:32 am


Return to DropMaster

Who is online

Users browsing this forum: No registered users and 0 guests