More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

forum 20-Oct-2014 16:08

Looking for help with Outlook programming projects — VSTO, add-ins, VBA, custom Outlook forms, etc.? You′ve come to the right place!

NEW! >> Subscribe to this site via RSS. For more RSS options, see the complete list of feeds on our main news page.

Login Password
Remember me
Register | Send my password
    Page [ 1 ]  
 Outlook Expert Techniques Printer Friendly Version
Working with toolbars, menus, ribbon; generating custom reports; deploying forms; connecting to databases, Exchange folders, and XML Web services
Topic
View.XML Documentation?
Does anyone know a good place to find documentation on the XML that comes out of View.XML? I can't figure out how to set the prop element to link it to a UserProperty. The code source shows what I've been trying. If I put in the Microsoft URI for ReminderSet, it actually works. Thanks for any help!

...
public void RandomFunction()
{
    ViewColumn column = null;
    ....
    if (column == null)
    {
        column = new ViewColumn()
        {
            Name = cActivityLogViewColumnName,
            Heading = cActivityLogViewColumnName,
            Editable = false,
            Width = 18,
            DisplayFormat = 3,
            Bitmap = true,
            Type = ViewColumn.ViewColumnType.boolean,
            Style = "padding-left:3px;;text-align:center",
            Property = "http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8503000b"
        };
    }
    ViewManager.Default.AddColumn(view, column, 0);
}
...

public class ViewManager
{
    public void AddColumn(View view, ViewColumn column, int columnIndex)
    {
        var xmlDoc = new XmlDocument();
        xmlDoc.LoadXml(view.XML);
        ...
        viewNode.AppendChild(column.ToXmlNode(xmlDoc));
        ...
        view.XML = xmlDoc.InnerXml;
    }
}

  09-Nov-2009  14:51
  09-Nov-2009  15:26   
Easiest way to see that for yourself is to add the custom property to the view and then look at the <column> element for that property. You can also see the schema name for the property in the SQL tab of the Filter dialog, if you use it to filter a view, and, of course, with the Outlook Spy tool.
  09-Nov-2009  15:29   
You might also find this reference helpful: http://msdn.microsoft.com/en-us/library/bb147567.aspx
  09-Nov-2009  15:32   
Both comments are EXTREMELY helpful. Thank you very much!

If I look in OutlookSpy and see <prop>http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/MyUserPropertyName</prop>

Is that a string I can copy and paste and distribute and will work anywhere? Or do I have to determine the Guid somehow?

Thanks again!
  09-Nov-2009  15:56   
The GUID for custom properties created with UserProperties.Add or ItemProperties.Add is always the same.
  09-Nov-2009  15:58   
Awesome, thanks a lot!
    Page [ 1 ]