TaskItem properties in Outlook.View XML property

B

Belikov

Hi!

I am developing AddIn for Outlook 2003 with VSTO SE and VB.NET
It should export Outlook tasks in custom view with any set of columns (including user properties) to Word.
To get sort and filter settings for Current View I am parsing CurrentView.XML. This works ok.
But I also need to know columns of Current View.
The only way I found is to get heading (in my case its localized) and find corresponding property in big select-case expression. It means that if I mistype or user change column name in view it will break my addin. I think that there must be better way to do this with string in prop tag (mapi/id and stuff). But how can I translate it to Task property name?
<column>
<heading>Срок</heading> <prop>http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81050040</prop>
<type>datetime</type>
<maxrows>183631872</maxrows>
<width>70</width>
<style>padding-left:3px;;text-align:left</style>
<format>M/d/yy</format>
<displayformat>12</displayformat>
<bestfitdate>0</bestfitdate>
</column>
Another problem is format of values. I can see displayformat index, but how can I use it to format values?
 
K

Ken Slovak - [MVP - Outlook]

The only way to interpret the property tags is with a list for comparison or
a case block or something like that. You will find many different schemas
representing various Outlook properties and other than some schema parsing
tool, which likely would be far slower than a case block there are no other
alternatives.

DisplayFormat relates to the various formats available for displaying
properties. The best way to get a list of those is to work with a custom
form and add properties with different formats and note down what values are
used in DisplayFormat. I'm not aware of any specific compiled list of
formats but there may be some out there somewhere. That you'd have to search
for.
 
B

Belikov

Thanks for your answers.

I am using case block, but it requiers a lot of testing to determine which property hides behind specific header translated in russian. Some properties i just can't find. Also if user change column name it will break it all.
Maybe there is some way to get property <prop> information from TaskItem object, to compare it with text in <prop> tag?
 
K

Ken Slovak - [MVP - Outlook]

You can't get the DASL type properties or names from anywhere but an
Extended MAPI query on item. Using ItemProperties or UserProperties won't
return any properties in a DASL type format such as
"urn:schemas:httpmail:textdescription".
 

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