Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

SPFile.Publish - Not publishing new changed document

$
0
0

I'm publishing the approved documents into the repository using below code - 

 SPFolder documents = webRepo.GetFolder(Repository);
 SPFile newFile = oFile.File;
 byte[] binFile = newFile.OpenBinary();
 SPUser creator = webRepo.CurrentUser;
 SPUser modifier = webRepo.CurrentUser;
 DateTime creationDate = DateTime.Now;
 DateTime modificationDate = DateTime.Now;

 SPFile oNewVersion = documents.Files.Add(oFile.Url, binFile, creator, modifier, creationDate, modificationDate);
 oNewVersion.Publish(string.Empty);

But document is not new version showing changes. It is same old document in Repository.

Please let me know if I'm missing something or need to activate certain feature to achieve it.

Thanks !!


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>