SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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