Paul Liebrand's Weblog

Welcome to my blog mainly about SharePoint

Skip to: Content | Sidebar | Footer

Google Search

SharePoint + Word + Metadata + Spaces = Death

16 January, 2012 (11:08) | Office, SharePoint | By: Liebrand

This morning I received an interesting support ticket.  The reported issue was that when clicking a document from SharePoint it would completely freeze the browser and Word.  I tried it from my desk and was able to reproduce the issue. It was only occurring with a specific document.

Immediately I thought this form must be corrupted. I saved it to my local desktop and was able to open the file without any issues. Bizarre – I click the File menu (I am running Office 2010 but problem exists on both 2007/2010) and all of a sudden Word froze and I received the “Not Responding” message in the title bar. I finally had to kill the process; tried it again, same issue.

I extracted the contents of the DOCX file and started investigating the content.  I noticed that the document had metadata columns from SharePoint with some values in them. One metadata column stood out from the rest because it had about 20 blank spaces at the end of it.

1-16-2012 10-59-41 AM

I deleted all the blank spaces, re-compiled the DOCX file, and tested it and the problem was gone.

I thought to myself there had to be something special about this document. So I decided to create a brand new SharePoint library with a couple metadata columns and then created a brand new Word document. When I edited the Word document, I immediately went into the Document Properties panel, keyed in some text, and then added about 20 blank spaces. When I clicked the save button, word hung again with a “Not Responding” message.

Decided to do a few more iterations; I added 1 trailing space, worked fine, 2, worked fine, 3, worked fine. I started to notice that the more spaces I added the slower the “Save” dialog got until I eventually hit about 13 spaces and it no longer returned and Word completely froze.

Under normal circumstances, you should never have this many spaces trailing your metadata but I think this user cut and paste the text from another location and selected too much.

In the past, I have had numerous issues that involved Word freezing when saving or opening but never knew the root cause. We generally fixed it by re-creating the document. I at least now have another location to check before we resort to re-creating a document.

Check it for yourself – you will no doubt have the same issue.


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

  • Naked Programmer

    Paul,
    Thanks for a good article. I have been having the same problem with all Office documents that are uploaded to SP using a 3rd party software application. Whenever I try and check the document out (or save it locally and go the File menu) Word would freeze. I am convinced its a property thats being set via the contenet type when the document gets uploaded to SharePoint.
    After unpacking the Office 2010 file, I cannot see the custom properties from the content type so I am unsure in what XML file you found the offending properties?
    Naked Programmer