Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Deleting the duplicate versions of a file from sharepoint server

  Asked By: Edward    Date: Feb 07    Category: Sharepoint    Views: 1533

While uploading a file from the client machine to the sharepoint server using
FileSystemWatcher,one or more versions are created in the sharepoint site withe
same date and time.

I need to avoid this.I had used the versions created time to delete the previous
version and the coding is

For vi = 0 To oldFile.Versions.Count - 1
WriteLog("version created" & oldFile.Versions(vi).Created.ToLocalTime)
WriteLog("modified at=" & modifiedAt)
If oldFile.Versions(vi).Created.ToLocalTime = modifiedAt Then
oldFile.Versions.DeleteByID(oldFile.Versions(vi).ID)
WriteLog("deleted")
End If
Next

But the oldFile.versions.count gives actualversioncount-1.
I dont know to proceed.

Please guide me,Is there anyway to delete the duplicate versions of a file.

Share: 

 

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

 




Tagged: