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

Is there a way to programmatically move an existing list item (SPListItem) to a folder or do I need to make a new item that is a duplicate of the list item in the folder in question and then delete the old one?

share|improve this question

It is not explicitly a file but you can still use it as one. Here's an example I've used before:

SPListItem item;
SPList list;
SPWeb web;
string DestinationFolderPath;
SPFile file = web.GetFile(item.Url);
string destinationUrl = list.RootFolder.ServerRelativeUrl.TrimEnd(new Char[] { '/' }) + "/" + DestinationFolderPath + "/" + item.ID.ToString() + "_.000";

You could make a new item that is a duplicate but you'll run into issues if you have lookups to that item. Since the new item will have a new ID, the lookup will be broken.

share|improve this answer

If its a file you can use the SPFile.MoveTo command.

share|improve this answer
SPListItem Not a file. – Robert Kaucher Sep 14 '12 at 23:11

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.