Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Deleting Document from Document library

  Asked By: Stacey    Date: Nov 02    Category: Sharepoint    Views: 1260

How to delete a document by using Object model

I am trying this code

SPSite objSite=new SPSite(siteUrl);

SPWeb objWeb=objSite.OpenWeb();
SPFolder objFolder=objWeb.Folders[docsFolder];
objFolder.Files.Delete(attachmentUrl);

attachmenturl is fullURL for eg :(http://portal/sites/sitename/foldername/do1.doc)

error was Value doesn’t fall in expected range

Any solution ?

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Deleting Document from Document library Or get search suggestion and latest updates.




Tagged: