A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

C# ComAddIn: Imitate "Drag & Drop"



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 3rd 06, 12:44 PM posted to microsoft.public.outlook.program_addins
Ole Jaekel
external usenet poster
 
Posts: 1
Default C# ComAddIn: Imitate "Drag & Drop"

Hello everyone!

I would like to imitate Outlooks Drag & Drop functionality on this case:
When you drag and drop an email message into the body of a Outlook Task Item
you normally receive a clickable link (named like the emails subject), which,
when clicked, opens the dropped email.

I would like to create such a link/reference using a ComAddIn. So far I
tried and succeeded to add an email to a task item as an attachment. the
email also appears in the body of the task item but is not clickable to open
the email.

my source code looks like this:
Code:
using MOIO = Microsoft.Office.Interop.Outlook;
....
//get the task item
MOIO.NameSpace olNS = ((MOIO.Application)applicationObject).GetNamespace
("MAPI");
MOIO.TaskItem iTaskItem = (MOIO.TaskItem) olNS.GetItemFromID(itemEntryID,
itemStoreID);
//get the mail item (same subject)
MOIO.MailItem iMailItem = null;
MOIO.MAPIFolder oMailFolder = getFolder("Posteingang");
MOIO.Items oItems = oMailFolder.Items;
foreach (MOIO.MailItem mail in oItems){
if (mail.MessageClass == "IPM.Note" &&
mail.Subject.Equals(iTaskItem.Subject.ToString())) {
iMailItem = mail;
}
}
//add mail as attachment to task item
iTaskItem.Attachments.Add(iMailItem, MOIO.OlAttachmentType.olByReference,
iTaskItem.Body.Length+1, iMailItem.Subject);
....

Can I use the method Attachments.Add to achieve this? do i have to alter the
parameters?

in the link you can see the result.
left attachment is added manually, right attachment is added
programmatically by my addin
http://web.inf.tu-dresden.de/~oj8534...chment.Add.GIF

I'd appreciate any suggestions!

Ciao Ole Jaekel


Ads
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Only when i forward emails with attachements "550 relaying mail to" [domain] "is not allowed" Alchemy Outlook - General Queries 4 March 8th 06 11:47 PM
Export & Import of outlook 2003 "User Defined Fields" at folder le Kamele0n Outlook - Using Contacts 1 February 25th 06 04:34 PM
Can not Drag and Drop when using imap [email protected] Outlook - General Queries 0 February 7th 06 02:47 PM
Can't Drag & Drop between outlook 2003 & sharepoint calendar Rainman Outlook - Calandaring 0 February 1st 06 03:00 PM


All times are GMT +1. The time now is 08:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.