locked
Export Word Document Revisions To A File RRS feed

  • Question

  • Hi guys...it's e-learning application for Microsoft Office Word.

    i need to send to a client application two files : "original file.docx" and "modified file.docx", but the files are the same at 90% ! just a few changes occurred (changing a font or color of paragraph or title !!!) so i thought about creating the first file "original file.docx" and than activating "Track Changing" and make the changes to have the "modified file.docx", and then exporting the "Revisions" (i don't know if this is possible) to a file (like serialization or something else).

    So the client application will just have to download the "original file.docx" and make a copy and apply the "Revisions" to that copy and then it will be "modified file.docx" ! i think this way i will lose in size at the download time... and the download will be faster !?

    i don't know if this is possible, if yes please show me how, and if you have a better suggestions i will be thankful :)

    Thursday, November 28, 2013 5:49 PM

Answers

  • Word doesn't have this functionality built in. However, you could use a macro to create a revisions table with, say, two columns - one for additions, the other for deletions. IMHO, though, you'd do better to send both the original and a final, so the reviewer can use Word's 'compare documents' tools to see the changes.

    The most compact solution, though, would be to send the reviewer one file, with tracked changes. That way, the reviewer can toggle the view between original & final, with or without markups shown and whether to show the revisions in-line or in balloons, all without needing to work with multiple files.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by Carter Nolan Saturday, November 30, 2013 12:30 AM
    Friday, November 29, 2013 7:23 AM
  • i did it an it's working, i saved the file with the tracking changes activated !

    and to get The Original One, i cancel Revisions !

    private void ExtractOriginal()
            {
                object missing = System.Reflection.Missing.Value;
    
                object readonlyobj = false;
                app = new Word.Application();
    
                object source = @"c:\file1.docx";
    
                //opening the File
                doc1 = app.Documents.Open(
                ref source, ref missing, ref readonlyobj, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
    
                //Canceling Tracking To get Original File
                doc1.Revisions.RejectAll();
                doc1.TrackRevisions = false;
                doc1.ShowRevisions = false;
                doc1.PrintRevisions = false;
    
                //Saving a Copy
                object file1 = @"C:\Original.docx";
                doc1.SaveAs(
                    ref file1,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing);
    
                MessageBox.Show(@"Fichier Original Sauvgardé !");
            }

    and to Get The Final File, i apply Revisions 

    private void ExtractFinal()
            {
                object missing = System.Reflection.Missing.Value;
    
                object readonlyobj = false;
                app = new Word.Application();
    
                object source = @"c:\file1.docx";
    
                doc1 = app.Documents.Open(
                ref source, ref missing, ref readonlyobj, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
    
                //Saving a Copy
                object file1 = @"C:\Final.docx";
                doc1.SaveAs(
                    ref file1,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing);
    
                //Accepting Tracking 
                doc1.Revisions.AcceptAll();
    
                doc1.TrackRevisions = false;
                doc1.ShowRevisions = false;
                doc1.PrintRevisions = false;
    
                MessageBox.Show(@"Fichier Final Sauvgardé !");
            }

    Thank you So Much Paul.

    • Marked as answer by Carter Nolan Saturday, November 30, 2013 11:32 AM
    Saturday, November 30, 2013 12:42 AM

All replies

  • Hi,

    Thank you for posting in the MSDN Forum.

    Since the issue is more relate to the feature of Word, I'd like to move it to Word IT pro forum.

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Thanks for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 29, 2013 5:46 AM
  • Word doesn't have this functionality built in. However, you could use a macro to create a revisions table with, say, two columns - one for additions, the other for deletions. IMHO, though, you'd do better to send both the original and a final, so the reviewer can use Word's 'compare documents' tools to see the changes.

    The most compact solution, though, would be to send the reviewer one file, with tracked changes. That way, the reviewer can toggle the view between original & final, with or without markups shown and whether to show the revisions in-line or in balloons, all without needing to work with multiple files.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by Carter Nolan Saturday, November 30, 2013 12:30 AM
    Friday, November 29, 2013 7:23 AM
  • but i need the solution to be in C#, it's an application that i want to build
    Saturday, November 30, 2013 12:28 AM
  • i did it an it's working, i saved the file with the tracking changes activated !

    and to get The Original One, i cancel Revisions !

    private void ExtractOriginal()
            {
                object missing = System.Reflection.Missing.Value;
    
                object readonlyobj = false;
                app = new Word.Application();
    
                object source = @"c:\file1.docx";
    
                //opening the File
                doc1 = app.Documents.Open(
                ref source, ref missing, ref readonlyobj, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
    
                //Canceling Tracking To get Original File
                doc1.Revisions.RejectAll();
                doc1.TrackRevisions = false;
                doc1.ShowRevisions = false;
                doc1.PrintRevisions = false;
    
                //Saving a Copy
                object file1 = @"C:\Original.docx";
                doc1.SaveAs(
                    ref file1,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing);
    
                MessageBox.Show(@"Fichier Original Sauvgardé !");
            }

    and to Get The Final File, i apply Revisions 

    private void ExtractFinal()
            {
                object missing = System.Reflection.Missing.Value;
    
                object readonlyobj = false;
                app = new Word.Application();
    
                object source = @"c:\file1.docx";
    
                doc1 = app.Documents.Open(
                ref source, ref missing, ref readonlyobj, ref missing, ref missing,
                ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
    
                //Saving a Copy
                object file1 = @"C:\Final.docx";
                doc1.SaveAs(
                    ref file1,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing,
                    ref missing);
    
                //Accepting Tracking 
                doc1.Revisions.AcceptAll();
    
                doc1.TrackRevisions = false;
                doc1.ShowRevisions = false;
                doc1.PrintRevisions = false;
    
                MessageBox.Show(@"Fichier Final Sauvgardé !");
            }

    Thank you So Much Paul.

    • Marked as answer by Carter Nolan Saturday, November 30, 2013 11:32 AM
    Saturday, November 30, 2013 12:42 AM