I have a huge number of documents uploaded to the document library. These are the word and excel documents. We have some links within the documents refering to the old URL of the sharepoint website. How do I updated these URLs which are within the documents of Sharepoint document library.


You need to update SPFieldUrlValue value for each of your document.

Here's example,

foreach (SPListItem item in list.Items)
                        Object rawValue = item[SPBuiltInFieldId.URL];
                        SPFieldUrlValue typedValue = new SPFieldUrlValue(rawValue.ToString());

For more information check these links out,

Update Document meta data in SharePoint library using Event Receiver

SPFieldUrlValue class

How to programmatically create document set, add or move files, GetDocumentSetById

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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