473,471 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Drop a link to Outlook message

Hi guys, maybe it's a silly question, but I'm quite stuck with it...
I've tried to implement a drag and drop operation from inside my c#
program. What I would like to do is allow to copy a link to an Outlook
message from my application. So I use:

button1.DoDragDrop("http://www.google.com", DragDropEffects.Copy);

The text string is copied correctly but Outlook doesn't recognize it
as a link. I have tried to use the HTML fragment for a link, but it's
always the same, the text is copied "as is". I don't understand why,
for example, I drag the URL from Firefox to the Outlook message...in
this case Outlook recognize it as a link and activate it. How can I do
the same in my application?

thank you in advance for your help

cold
Jul 22 '08 #1
3 2716
cold,

Instead of passing a string (which is placed on the clipboard as text)
you have to place an object that implements IDataObject (the DataObject
class will work) and set the type to "UniformResourceLocator" or
"UniformResourceLocatorW" and pass a memory stream that has the ASCII or
Unicode string which is the URL you want to drop. This should allow you to
drop a URL wherever you want.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"cold80" <co****@libero.itwrote in message
news:78**********************************@c58g2000 hsc.googlegroups.com...
Hi guys, maybe it's a silly question, but I'm quite stuck with it...
I've tried to implement a drag and drop operation from inside my c#
program. What I would like to do is allow to copy a link to an Outlook
message from my application. So I use:

button1.DoDragDrop("http://www.google.com", DragDropEffects.Copy);

The text string is copied correctly but Outlook doesn't recognize it
as a link. I have tried to use the HTML fragment for a link, but it's
always the same, the text is copied "as is". I don't understand why,
for example, I drag the URL from Firefox to the Outlook message...in
this case Outlook recognize it as a link and activate it. How can I do
the same in my application?

thank you in advance for your help

cold

Jul 22 '08 #2
Thank you for your reply but actually it doesn't seem so easy. I mean,
you suggestion is quite right but I've read some new articles using
the trail you left me and I haven't found a solution that works with
different e-mail clients yet. Do you have an example or something? For
example I've found this one

http://www.codeproject.com/KB/cs/dra...tshortcut.aspx

but it doesn't work with Thunderbird for example...

thank you again for your help

cold
Jul 23 '08 #3
cold,

Regarding the article, I saw the same one, and to drag a URL, the only
thing you should have to populate is the UniformResourceLocator and
UniformResourceLocatorW data types on the DataObject.

Do you have some code that you are using to populate these?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"cold80" <co****@libero.itwrote in message
news:20**********************************@a70g2000 hsh.googlegroups.com...
Thank you for your reply but actually it doesn't seem so easy. I mean,
you suggestion is quite right but I've read some new articles using
the trail you left me and I haven't found a solution that works with
different e-mail clients yet. Do you have an example or something? For
example I've found this one

http://www.codeproject.com/KB/cs/dra...tshortcut.aspx

but it doesn't work with Thunderbird for example...

thank you again for your help

cold

Jul 23 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gerald Zukrigl | last post by:
Hi all, I want my application to be the drop target for ms-outlook-emails. I'm getting several formats by GetData from the DragEventArgs. I want to store a reference to the dragged outlook...
0
by: Andrew | last post by:
I need to drag-and-drop a Outlook message into a vb.net Windows Forms application. Dragging directly from Outlook does not provide the "FileDrop" drag type. Any help would be appreciated Thank you...
3
by: John | last post by:
Hi I am using the below code to generate an outlook message from a template from within access. I am getting the 'Object variable or With block variable not set' error on the line indicated....
3
by: Jim | last post by:
I have a user who works remotely who just does not understand the concept of zipping and unzipping files no matter how many times I explain it. I need to create something for her that will do the...
0
by: Brian Burgess | last post by:
Hi all, Anyone know to get the full path name of a file dragged from an Outlook message? I can get the filename itself so far, without the path. For Outlook 2000 I know the path would be...
3
by: Thomas | last post by:
Hi all, I've got a half-functioning drag-drop from outlook app running. I can get the name of the message from the FileGroupDescriptor part, but whenever I try to get the FileContents part, I...
6
by: David Anderson | last post by:
Does anyone know how to drag&drop a message with attachments from Outlook (2002 or 2003) in to a VB.Net windows form. This is really stumping me. I've spent a fair amount of time trying to find a...
3
by: Jason | last post by:
Hi, I built a vb.Net application that creates ICS calendar files dynamically and then sends them to the client browser as a downloadable file. Works perfectly except in the following situation....
4
by: phil2phil | last post by:
hi, Is there a way to get an outlook message to prepopulate when a user clicks a link on a webpage? rather than just a blank email window opening up, i wanted to put some body there.
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.