c# - 从 C# 拖放到 Outlook

标签 c# drag-and-drop outlook

我有一个用 C# 编写的文档控制系统。 从 Outlook 拖放到 C# 已经完成了一段时间。现在许多文件都在 C# 应用程序中,用户自然希望能够从我的另一个方向拖放文档控制系统 Outlook。

由于文件存储在文件系统中(而不是作为 SQL 数据库中的 blob),我让它们打开文件夹 View 并从那里拖放。但是,这允许绕过文档管理系统的版本控制。

我可以构建一条拖放消息来通知 Outlook 我要放置的文件名和路径吗?我怀疑这已经完成,但我的搜索量被相反方向的回复数量淹没。

最佳答案

从这里开始:

http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/f57ffd5d-0fe3-4f64-bfd6-428f58998603/

//put the file path is a string array
string[] files = new String[1];
files[0] = @"C:\out.txt";

//create a dataobject holding this array as a filedrop
DataObject data = new DataObject(DataFormats.FileDrop, files);

//also add the selection as textdata
data.SetData(DataFormats.StringFormat, files[0]);

//do the dragdrop
DoDragDrop(data, DragDropEffects.Copy);

关于c# - 从 C# 拖放到 Outlook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10541004/

相关文章:

Outlook 对象模型 - 连接到对话清理功能

c# - 使用 javascript 函数在特定条件下从代码隐藏中调用

c# - Unity3D C# Button Sprite 交换 - 在运行时附加图像

c# - Asp.Net Core MVC 中的 Request.IsAjaxRequest() 在哪里?

delphi - 使用 Melander 的 DragDrop 套件时如何允许异常

azure - 微软图形API : assignments(plannerAssignment) property of Task Resource(plannerTask ) is not working

c# - 使用 Fluent nhibernate 自动映射继承

cocoa - 使用什么代替 NSOutlineViewDataSource 轮廓 View :draggingSession:endedAtPoint:operation:?

html - dragexit vs dragleave - 应该使用哪个?

PHP 发送到 Outlook PDF 文件