Track changes in MS Word

Welcome Forums General PowerShell Q&A Track changes in MS Word

This topic contains 3 replies, has 3 voices, and was last updated by

7 months ago.

  • Author
  • #112186

    Topics: 1
    Replies: 1
    Points: 0
    Rank: Member

    Dear all, I am quite new to PowerShell but know my way around the basics. Yet, I still have not been able to find whether it is even possible to track changes in MS Word through PowerShell script.

    I already have a look&replace string written. It looks for a word, and replaces it with another, in MS Word. Now I need to know whether it is possible to highlight that word in some way, so that I can later open each of the Word files and make any necessary edits around that word.

    Any help greatly appreciated!!




  • #112198

    Topics: 12
    Replies: 215
    Points: 380
    Helping Hand
    Rank: Contributor

    Haven't tested it but if find/replace is what you're after then maybe:

  • #112211

    Topics: 2
    Replies: 876
    Points: 1,352
    Helping Hand
    Rank: Community Hero

    Track changes is a MSOffice feature not a PS one.

    You can't track changes to a doc via PS. You can track document modifications by creating hashes of files when they are created and then doing a hash check again at a later date and compare. If the hash is different the document was changed.

    The hash won't tell you what was changed, jus that that calculation will show it has. To see what actually was changed, you need to do a compare between the two docx, and take actions on the results.

    Or, use the Office Object model and use the MSWord RevisionObject to see if you can leverage that for what you are after.

    If you mean, highlight the word you changed in the docx via the script, then Words track changes, if set should do that automatically, because you have to open Word to change the docx, and whatever Word settings are in place for your profile, should have impact, otherwise, you'd use the OOM to set the color on the change yourself manually.

  • #112490

    Topics: 1
    Replies: 1
    Points: 0
    Rank: Member

    Hi all, I just wanted to thank you for the suggestions! I found a way to track the changes:

    $objDoc.TrackRevisions = $true

    $objDoc.ShowRevisions = $true


    When tracked with this, they look exactly like they do if you did it directly through MS Word.



The topic ‘Track changes in MS Word’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort