Embedding document version history into the word document

Answered Embedding document version history into the word document

  • Tuesday, May 01, 2012 5:06 PM
     
     

    I would like to print (embed) my document version history into the document library word document....?

    Can it be done using event receiver -- ItemCheckedIn event....?

    I would appreciate if someone show me the right path....

All Replies

  • Tuesday, May 01, 2012 5:20 PM
     
     

    It is already embedded (click on the ribbon file (msword))

    You may also define Information Management Policy (guide):

    1. Click on Settings > Document Library Settings
    2. Click on “Versioning settings” and make sure that you’re either having it “create major versions” or “create major and minor (draft) versions”.
    3. Click OK.
    4. Click on “Information management policy settings”
    5. Select “Define a policy…” and click OK.
    6. Check the “Enable Labels” box, but don’t check either of the other two boxes in that section.
    7. Type {_UIVersionString} into the “Label format” box.
    8. Click on the “Refresh” button to see a preview of your version label. It will say something like {_UIVersionString}
    9. Click OK.

    LinkedIn Profile

  • Tuesday, May 01, 2012 6:46 PM
     
     

    Thanks though. I think Im looking for pulling entire version history ( like No, Modified, Modified By, Comments) to the document itself..in a tabular format...

    so whenever the user check in the document, it should pull and append the history information into the word document....

  • Thursday, May 03, 2012 8:06 AM
     
     

    I've found similar thread.

    Anyway you can create item event receriver updating document content with SPListItem version information. Use OpenXML or ClosedXML to change the document.


    LinkedIn Profile

  • Monday, May 07, 2012 1:53 PM
     
     Answered

    I have done this using the following steps

    • Created Event receiver - ItemCheckIn() event
    • Created a multiline site column under Document history
    • Pull document history into the site column
    • Using Quickparts, Place the new column inside the word document template (under Version History section)..

    Thats it...

    • Marked As Answer by TarSam Monday, May 07, 2012 1:53 PM
    •