4

SP 2010, I have a document library with versioning turned on. If I populate title on the document, and save it... then I upload a new version of the document the title will get wiped out. How do I carry all of the metadata/properties forward to the new version? I can replication this quickly by just creating a new doc lib, turn on version, upload a doc, edit the doc properties and set a title, save it, upload the same doc again, when you go to the properties its empty again. Version history shows this happened.

Why in the world would you want to wipe it all out every time? Am I missing something or am I going to have to code a solution?

3 Answers 3

6

This is by design, or rather caused by a lack of understanding how this works.

In a document library, the basic metadata columns and Word's file properties are linked.

  • You upload a Word file.
  • The Word file does not have the document property "Title" filled in.
  • The "Title" property as stored in the file will update the SharePoint column.
  • Since the Word file's Title property is empty, SharePoint's Title column will show as empty.
  • You fill in the Title field in SharePoint.
  • You go back to your file on the hard drive (still no "Title" property in the Word file).
  • You edit the file
  • You upload the edited file.
  • The "Title" property as stored in the file will update the SharePoint column. But the file still has no "Title" set in the Word properties, hence the Title column in SharePoint will appear empty again.

The title column is part of the Word file. If you start your edits from the version that you uploaded to SharePoint, after you have added the title, then you will find that the title property in Word has actually been populated by the title you entered into the SharePoint column.

So, you made a change to the document after you uploaded it to SharPoint, and then that change gets overwritten by the "new version" that you uploaded.

2
  • That is very interesting. I actually was afraid that might be the case. So what happens when I am dealing with cad file and other files that would have no such properties? I guess I am just out of luck? This will be the case for the large part... it seems SharePoint only works well for MS office documents. You think I could use an event handler on ItemAdded event and pull the last version and set the properties before the user gets the dialog?
    – CrazyDart
    Commented Mar 26, 2013 at 3:34
  • 1
    No, the metadata will not be overwritten. It will be refreshed according to the document properties. If no such document properties exist, and if you check to replace an existing file when uploading a new one of the same name, the metadata stays intact. So, a PDF, which does not have a Title document property that is linked to a SharePoint column will retain its column value when the file is replaced with a newer version. The tight integration of Office and SharePoint enables metadata to be set from within Office, hence your experience.
    – teylyn
    Commented Mar 26, 2013 at 4:10
1

It can be solved by writing custom event receiver which backup original values, then doing update, and after loose values set values again from backed up ones. Then update again.

0

I'm having the same issue with SharePoint Online, how would I write a custom event receiver to backup original values? I'm fairly new to SharePoint.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.