SharePoint Evil #4: Document Information Panel always defaults to first content type in the library

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:

Document Property

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?

  1. Go to the content type at site collection level
  2. Edit the document template
  3. Delete the property and save the template
  4. 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.

Advertisements

About Bernado

Based in Australia, I am a freelance SharePoint and Dynamics CRM developer. I love developing innovative solutions that address business and everyday problems. Feel free to contact me if you think I can help you with your SharePoint or CRM implementation.
This entry was posted in Document Information Panel, SharePoint, SharePoint 2010, SharePoint Evils. Bookmark the permalink.

7 Responses to SharePoint Evil #4: Document Information Panel always defaults to first content type in the library

  1. JohnFlynn says:

    Hi – What about it you don’t want any ‘default’ DIP entries, from the template – Just blanks etc.?

    Best regards – John

    • Bernado says:

      Hi John,

      Do you mean don’t show the DIP at all? Or do you mean show it, but don’t have any default value selected in the drop down fields?

    • David says:

      Hi Bernado, A question if I may: I am using a content type(CT-X) – which is being ‘send to’ using a global send to connections – to a drop-off library in a document center- with content organizer to route based off a user selected content type (one of 8 Content Types [CT1-CT8] , but not CTX) , I want the user to then select the content type within the ‘drop off library’ – if they use the send to they should Click the LINK, which brings up the edit form(select content type – all is happy), however if they press ‘OK’ and the document gets stuck in the drop-off library – Is there a way for the user to change the content type from WORD – It currently gets the default content type (I want it not to default? but keep CTX and provide a drop down for content type? Thanks for the post…

      • Bernado says:

        Hey David – I have not worked with the drop off library before so I’ll take a wild guess – would it do what you want if you add the CTX content type to the drop off library and make that the default content type for that library?

  2. Stephen says:

    Hi, thanks for the article, very useful. I have seen a similar problem on SharePoint 2010/Word 2010 where Word would display the incorrect CT in the DIP.
    Attaching a new blank Word (dotx) template (at the library level) resolved this.

  3. Pingback: SharePoint 2013 Word Document Information Panel Issue | sharepointv15

  4. amccollough says:

    I totally love your definition of “SharePoint Evil”. You must have stopped writing a long time ago, because you only have FOUR evils so far. My co-worker and I could probably spew up 50 of ’em in an hour. I would heartily encourage you to list more of ’em. For example: Related lists. Try to “Add new item” and you end up with a menu that shows nothing but two select menus containing the numerical IDs of the list items. Utterly useless. Another evil: Workflows. A thousand evils live within that topic alone. My pet evil of workflows: You can trigger a workflow on a document add, or update, but not on a delete. Argh!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s