Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.