How do I access the AssignedTo property in an outlook 2007 task?

J

JAdams

I've been hunting everywhere but can't put the pieces together. I have a
public folder with tasks that we use with a customized form. The custom form
includes the assign to button and we use it to assign tasks to contacts even
though the functionality doesn't work for public folders. The contact is
saved in the assigned to field, but I can't get access to the AssignedTo
property for a TaskItem. How can I access the AssignedTo property for my
task in vb?

Thanks!
 
K

Ken Slovak - [MVP - Outlook]

Try looking at the Owner property of the task item. Whoever accepted a task
assignment is the new owner.
 
J

JAdams

Hi Ken,

Thanks for the response and I love your website! In this case, the owner is
not the same as the assigned to. Since this is in a public folder, the
assign to functionality (you know asssign, they accept, etc) doesn't work (we
are using standard exchange with ol 2007, not sharepoint.) So the owner is
actually saved as me because I created the task and the assigned to is
another person which basically is just another information field since the
functionality of assignment doesn't really do anything in public folders. I
can close and open the task and it remains this way. I'm scratching my head
as to where the AssignedTo property falls in the object model since it
doesn't appear to be under the Task properties. Any other ideas?

Thanks!
Jeff
 
K

Ken Slovak - [MVP - Outlook]

There is no AssignedTo property, unless you are creating that as a user
defined property.

I'm not sure how your custom task form is working, normally in a primary
Tasks folder when you assign a task the Owner property changes, as do
various recipient properties such as To. But I have no idea what your form
is doing.

I'd suggest using a MAPI viewer such as the free MFCMAPI from an MS download
or OutlookSpy (www.dimastr.com) and taking a look at the properties on an
item before and after you assign it with your custom form. That would be the
best way to go about finding that information.
 
J

JAdams

Hi Ken,

Thanks for the info. I downloaded MFCMAPI and I can now see the property.
It is labeled PR_DISPLAY_TO_A, othername = PR_DISPLAT_TO_W, PidTagDisplayTo.
There's no property similar in the task properties. It appears along with
the BCC and CC, so I suspect it resides somehow in a mailitem object even
though this is definitely a task item. Can you help me out on how to access
it?

Thanks!
 
J

JAdams

Hi Ken,

One thought, I just realized. I use a custom form and the item is
displaying as a post item. I instantiate my retrieval as taskitems, and I'm
able to retrieve them and view the properties in that context. But perhaps I
should be using a different model?

Thanks!
 
K

Ken Slovak - [MVP - Outlook]

You need to set the large and small icons for any custom form on the
Properties tab or it will display with a Post item icon.
 
K

Ken Slovak - [MVP - Outlook]

Since that property is not exposed directly for a task in the Outlook object
model you would need to use the PropertyAccessor object in Outlook 2007, or
some other API in other versions of Outlook to access that property using a
MAPI property tag.

CDO 1.21 (no managed code, optional installation, security restrictions),
Extended MAPI (unmanaged code only, C++ or Delphi only), or Redemption
(www.dimastr.com/Redemption) can be used for that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top