View Single Post
  #3  
Old September 3rd 09, 03:11 PM posted to microsoft.public.outlook.program_addins
wclarke101
external usenet poster
 
Posts: 5
Default Using a PropertyAccessor custom datetime property in Views

Thanks Ken.

How do I add a PT_SYSTIME custom property to PropertyAccessor that would
then display as a date/time column in the grid?

Do you have sample code for the SetProperty method call and the XML column
tag I would need?

Thanks,
Wayne.



"Ken Slovak - [MVP - Outlook]" wrote:

http://schemas.microsoft.com/mapi/string. You are creating a PT_STRING8
property, not a PT_SYSTIME property, why would you expect it to correctly
display in the grid as a date/time column?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"wclarke101" wrote in message
...
Hello,

I'm having problems getting a datetime property (added using
PropertyAccessor) to display as a column in a customised View.

I've added the datetime property to the PropertyAccessor using the
following
code...

objMailItem.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/string/{FFF40745-D92F-4C11-9E14-92701F001EB3}/DocumentDate",
dtDocumentDate)

...where dtDocumentDate is a Date variable.

I've then tried to customise the folder's View to show this custom
property
as a column. This is the XML excerpt...

column
typedatetime/type
headingDocumentDate/heading
prophttp://schemas.microsoft.com/mapi/string/{FFF40745-D92F-4C11-9E14-92701F001EB3}/DocumentDate/prop
width200/width
stylepadding-left:3px;;text-align:left/style
editable1/editable
formatM/d/yyyy||h:mm tt/format
displayformat2/displayformat
/column

... but the when I run the application, the this DocumentDate column just
displays the word "None".

If i changed the XML to use a string column instead of a datetime column,
then it displays the date, but the column sorting doesn't work properly
because Outlook is treating the values as strings.

How do i reference a custom datetime property in the View XML? Any help
would be greatly appreciated.

I'm using VSTO with Outlook 2007.

Thanks,
Wayne.



Ads