.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Updating a Document Version

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :SharePoint
If a document is updated from version 1 to version 2, what happens to version 1? Can i get to it to open it? If so where? I know you can view the History, but you cannot open a previous version. I am just thinking from an auditing point of view, if the auditor wanted to see version 7, can i show them the document?

View Complete Post

More Related Resource Links

Updating a non MS Office document

Hi, We are using SP2007 My understanding that the only way to update a non Office file (eg .txt) without using My Network Places in a SharePoint document library is to do the following: check out the document save the document locally  upload the document as a new version check in the document Is this correct? If so ... if a user has full control on a given document but only read only access to the library it sits in, doesn't it mean they will not be able to update the document (without using My Network Places) as they don't have access to the libraries Upload option? We are trying to avoid using the My Network places due to using thousands of site collections across our organisation ie trying to find a specific library is hard to do and is a poor user experience.   Regards, Simon 

Changing fields while updating an InfoPath Form to a SharePoint 2010 Document library

My document library has following EventReceiver: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Receivers ListTemplateId="101"> <Receiver> <Name>EventReceiverDocumentLibraryItemUpdating</Name> <Type>ItemUpdating</Type> <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly> <Class>EventHandling.EventReceiverDocumentLibrary</Class> <SequenceNumber>10000</SequenceNumber> </Receiver> </Receivers> </Elements> Updating a browser enabled InfoPath form in the document library fires following event: Public Overrides Sub ItemUpdated(ByVal properties As SPItemEventProperties) Try Me.EventFiringEnabled = False properties.ListItem("Lastname") = "Testperson" properties.ListItem.ParentList.ParentWeb.AllowUnsafeUpdates = True properties.ListItem.SystemUpdate(False) ' solution 1 properties.ListItem.Update() ' solution 2 properties.ListItem.UpdateOverwriteVersion() ' solution 3 properties.ListItem.ParentList.ParentWeb.AllowUnsafeUpdates = False Me.EventFiringEnabled = True MyBase.ItemUpdated(properties) Catch ex As Exception Me.EventFiringEnabled = True E

Trying to include version history table inside Word document

Running MOSS 2007 with SP1, Office 2007.   I'm trying to create a table (doesn't have to be a table though) of a document's version history inside the document. This would be the history information kept by SharePoint. Since we can't even easily get just the current version number into the document I'm having problems and thought I'd see if anybody has a bright idea.   First, a couple facts. From Word 2007 it is possible to view the Document Library version information by clicking on the Office Button > Server > View Version History. This brings up the following: Click for screenshot   My goal is to get that version information displayed IN the document so when it is printed there is a document history. I tried using IRM label policies, but this only displays the current version and you can't include the comments.   After some digging I found the following code sample on MSDN:   Code SnippetDim dlvVersions As Office.DocumentLibraryVersions    Dim dlvVersion As Office.DocumentLibraryVersion    Dim strVersionInfo As String    Set dlvVersions = ActiveDocument.DocumentLibraryVersions    If dlvVersions.IsVersioningEnabled Then        strVersionInfo = "This document has " & dlvVersions.Count & " versions: " & vbCrLf        For Each dlvVersion In dlvVersions            strVersionInfo = strVersionInfo & _                " - Versi

Version number syncronisation between document libraries

When I perform a Move or Copy operation from one Document Library to another in SP 2010 (using Send To or Manage Copies feature) SP resets the version number to 0.1 even if the version number in the source library is 4.2 (for example). All other Metadata is copied correctly. Is their anyway to keep version numbers in sync between document libraries? Seems like quite an obvious requirement to me but could not see any other info on the net about this.. thanks in advance

Document Library version restore not behaving as expected on the "Name" column (file name)


After a rollback to a previous version, the value of the column "Name" in a document library is not restored. All other columns are restored properly. It seems that the column "Name" (file name) is excluded from the process of versioning.

I didn't find information on this behaviour on the internet. Any suggestions ?


Default Document and ASP.Net version ...



Two questions:

1. (Using IIS 6.0); Is there any way to set the default document that is served via an applictions web.config file? I know it can be done via the IIS Management console, but my site is hosted via a hosting service and we do not have access to such a utility.

2. Is there a way to specify which version of ASP.Net is used (ie: 2.0, 3.5, etc) via an applications web.config file?


Brent D.

View previous version of a file in document library using Client Object Model




Using Server-side object model, it is pretty simple to get the previous file versions. Say I wanted to view a file in its initial version, all I’d need to do is :




When using Client object model, I couldn’t any analogous method/property which would let me fetch the previous version of file.

Can somebody point me to a sample or the property which would serve my purpose?

Question about Workflow in Document Library with version control and check-in/out enabled



I use Sharepoint Foundation 2010 and have a workflow to set some metadata in a document with version control and check-in/check-out enabled (approval content is not enabled because anyone in the team can be a possible editor of the document).

My metadata is:

- a generated doc id with text+id (example P&D_1)

- a calculated status based in version: minor version = "on development" and major-version="published/approved"

I defined two workflows:

1) is called when item is created to define id and status.

2) is called when item is updated and status is re-calculated if version is major. (It is called in every item change, not only when user wants to publish a major version, because this option doesn't appear in SPD)

I noticed that sharepoint workflow must do a check-out to be able to update metadata, and because of this the version number is incremented. When version is minor, I don't care, but when version is major I have a problem, because just after publishing the version 1.0, the workflow changes metadata and the version to 1.1. and 1.1 means that the document is not approved anymore...


a) Isn't it possible to do the workflow to check-in and override the last/current version to not generate a new version??

b) Or is it possible to stop versi

Read old version of a document with excel services


In a version-control enabled document library full of excel spreadsheets (xlsx); I am trying to read values from it.

I have no problem with the latest document, (because I couldn't find anyway to reach the documents but the URL of them with OpenWorkbook method) the latest version's URL is simple like "http://spsite/excel library/file.xlsx" and the old version is like "http://spsite/_vti_history/512/excel library/file.xlsx".

And the old version cannot be opened and giving me the error:

The file that you selected could not be found. Check the spelling of the file name and verify that the location is correct 

Is there any way to deal with it and open. The same method can open spreadsheet and take the data from it, but when it comes to the old version it cannot find the file.

I think, there must be a permission issue on this thing for the old versions but I couldn't find anything.


Thanks in advance. I hope you guys can show me the light..

Sharepoint Document Version Control



I am wanting to migrate a number of existing documents into sharepoint so they can be version managed.  However, most of these documents are already up to version 10 etc (on a manual system), I am wanting to start the versioning in sharepoint at a particular version instead of 1.  Has anyone done this?

site member group can only open read-only version of the document


Hi there,

According to this video:
more than 1 person can open a word document and edit it at the same time.

When I test it, it doesn't work.
I can open it fine but my colleague can only open a read-only version.
We're both using Office 2010.
I found out that I'm part of OWNER group, while the other guy is just a MEMBER group.

I've checked the permission for MEMBER, it has "contribute" permission, which allow him to edit document library:
<label for="idspnidEditListItems">Edit Items  -  Edit items in lists, edit documents in document libraries, and customize Web Part Pages in document libraries. </label>

If I add him to OWNER group, he can work on it like the one on the video (link above).
Or, I can add individual user and assign DESIGNER role to it.

My question is: why he has to be in the OWNER group (or DESIGNER role)?
since we have many people working on the document but only 1 person to be included in the OWNER group, it's not a good idea to add everyone to OWNER

Restore a previous version of a document in a document library - error

  When I try to restore a previous version of a document in a document library, I get this error message:

"Updates are currently disallowed on GET requests. To allow updates on a GET, set the AllowUnsafeUpdates' property on SPWeb"

I am NOT running any custom code anywhere on my SharePoint site 

2010 SharePoint global setting for document Library version control?


Apparently new Document Libraries created in Sharepoint are no longer set up the way we would like as far as version control.  Is there any way to set up SP so that any new document library created has specific settings, through Central admin control?

Jack Galante Sr Systems Engineer

i do see that previous versions this was not possible, but was curious if they changed this in 2010?

SharePoint add converted document as new version on original file



I am implementing a custom SharePoint Document Converter. What I want is the Document Converter Framework to add the converted document as a new version of the original document.

In other words: I want to convert "test.doc" into "test.pdf" and "test.pdf" must not be added as a new file (listitem), but as a new version of "test.doc".

How can I accomplish this?



Locating documents with no checked in version across multiple sites and document libraries


I have searched and searched but have not found a solution anywhere. My problem is that we have a number of document libraries that require check out for editing and have mandatory fields. When users upload multiple documents the documents are kept checked out until a value is assigned to the field and the document is checked in. The issue is, that users may not complete the process and subsequently no other users can see the document.

We tried indexing the 'Checked out to' field and allowing for users to search based on this. However, this does not display documents with no checked in version and as such does not help...

Is there some way that we can make the search indexer crawl these documents or have a web part that lists documents checked out to the logged in user? We are using SharePoint Foundation 2010 which may make this more difficult.

Change document version number via database


Hi all,

I was blocked by an issue of document version number. The customer wants to move a document from one document library to another. After the document is moved, version number should be kept the same and metadata values of each version should also be kept.

File.MoveTo(string newUrl) method can move file and keep the same version number but lose the metadata in previous versions. Only the latest version has metadata values. Also this method cannot move file cross site collections.


Following is my solution:

1. Upload all the versions along with metadata to the new location and then delete the old file.

2. Update document version number in database directly.

Finally the solution works well, but I don't know if step2 will impact any other default logic in SharePoint system. Below is the logic to update version number.

            SqlConnection cn = new SqlConnection(connStr);
            SqlCommand cmd;
            string cmdTxt;


            cmd = cn.CreateCommand();

Recover last version of file properties in MOSS document library


After an overwrite to several hundred files we need a quick way to either restore the entire file to the previous version or ideal just the custom property fields.

I tried to find a way to script a query into the document library and collect the previous version custom data into an excel spreadsheet but could not find a solution.

I came across this post that indicated he was able to restore only the file properties but retained the current version (which was not his gold but would be mine).


He included a snippet of his code:

Would this work? is there a powershell equivalent?

Whats the easies way to make this code into a useful solution.


int versionCount = item.Versions.Count;
if (versionCount > 0)
// this only restores properties

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend