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 !!