View Single Post
  #2  
Old April 3rd 07, 05:07 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to get Microsoft.Office.Interop.Outlook.TaskItem from the IUnknown (C#)

If you already have a task item why are you going through hoops to get
another instance of the same task item that way? Why not just copy the
passed task item or create a new one or use NameSpace.GetItemFromID() to
retrieve another instance of the task item if you can get its EntryID
property?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Godandag" wrote in message
oups.com...
Hi all.

In other words, how to implement the method GetTaskFromIntPtr in the
code below?

using Outlook = Microsoft.Office.Interop.Outlook;

...

public void Method1(Outlook.TaskItem task)
{
IntPtr ptr = Marshal.GetIUnknownForObject(task.MAPIOBJECT);
Outlook.TaskItem task1 = GetTaskFromIntPtr(ptr); //
GetTaskFromIntPtr - ?
}

public Outlook.TaskItem GetTaskFromIntPtr(IntPtr)
{
????
}


Ads