Wednesday, February 2, 2011

Invalid or missing properties when saving an Office document

Sometimes you try to save an office document in SharePoint and it decides that it is missing some properties in something called the 'Document Information Panel'. This panel appears at the top of the Office client (Word, Excel, PowerPoint, etc) with the columns you have created within a document library for users to fill out key information ABOUT a document (often called document metadata) so that you can find that document in the future by using those columns.  Here's the thing:  when you see this error about missing or invalid properties - it usually means you filled out something incorrectly or there's something you forgot to fill out...but not in my case.  In my case, I did a bad, bad thing and created a column called DocType.  NEVER EVER CREATE A COLUMN WITH THE NAME OF DOCTYPE!!!!  It will immediately give you an error aftter you create it that it cannot get the ContentTypeID and will never allow you to edit the column again.

So, I decide that I'm going to fix it by just hiding the column. Well, that makes it so that I get the lovely 'invalid or missing properties' error but then there's no property that I can actually fix! I found a post here:  http://www.novolocus.com/2010/05/10/to-save-to-the-server-correct-the-invalid-or-missing-required-properties/ that shows that you can inspect your document within Office to remove Custom XML data and that that should fix the problem...it lets me then save the document. YAY! BUT....then I can't check the document back in.  So, I HAVE to leave DOCTYPE as an optional column and just tell users not to fill it in.  Moral of story - do NOT create a DocType column or you will see the following error messages:

'Object reference not set to an instance of an object.   at Microsoft.SharePoint.ApplicationPages.BasicFieldEditPage.get_ContentTypeId()'

'To save to the server, correct the invalid or missing required properties.'