A SharePoint Evil is an issue/error that is so ambiguous and misleading that Google will shows 50 hits, with 10 different suggested solutions, and none of them work for your particular case. (So the described below may not work for you – but I hope it will).
Note: The particular root cause described below is applicable to SP2007 only. SP2010 seems to have extra smart that will eliminate this particular root cause.
Symptom: You have more than 1 content type specified for a document library. You specified an Office 2007/2010 file as the document template for these content types. When you create a new item from 1 of these content types (via the New button of the document library), the Office app opens and the Document Information Panel (DIP) is displayed. It however always defaults to the first content type in the library, and not the one you actually selected to create a new document.
Cause: In my case it was because the Office document template associated with the content type had an incorrect reference to the content type stored internally within the Office file itself. The Office app seems to be using this reference to pick the content type to load the DIP and default to.
So where is this reference stored internally within the Office document? It is a custom property call ContentTypeId for Office 2007/2010 and ContentType for Office 2003:
If a content type could not be resolved from the value of this property, then the DIP defaults to the first content type in the library.
The document template for a content type at site collection level however, may not have this property at all – and in fact I think this is a better way to manage it. In this case, when the site collection content type is added to a library, the document template of the child content type is automatically updated with the ContentTypeId property with the right value.
If the document template of a content type at site collection level already has this property, but a content type could not be resolved from it, then when this content type is added to a library, the document template of the child content type will not be updated. It will keep the invalid value from the content type at site collection level – and this is how you end up with the problem.
This means when you upload a new document template for a content type at site collection level, you should ensure that it does not have the ContentTypeId property
Or at least ensure that the value of the property matches that of the corresponding content type.
[Can you upload a document template to a content type at the library level without the ContentTypeId property? Not sure – needs investigation.]
So how can you fix this?
- Go to the content type at site collection level
- Edit the document template
- Delete the property and save the template
- Update the content type and push the change down to all inherited content types. (If you have customised the template of the inherited content types then you will need another solution :D).
What’s this about it’s not an issue in SP2010?
It appears that in SP2010 there is extra smart to automatically update the document template when you upload it to the content type at site collection level (and when you edit it too). It will automatically put in/update the property with the right value if the new/updated template does not have the property, or has the property but with an incorrect value for the corresponding content type.