DCSIMG
Find all documents with "Track changes" using PowerShell - This blog has moved

This blog has moved

Find all documents with "Track changes" using PowerShell

One of our customers was wandering if it is at all possible to find, using PowerShell, all documents in a specific folder that have "Track Changes" activated.

This is what I came up with, and it works well:

 

function FindTrackRevisions ([string] $path) {

    $files = Get-ChildItem $path -Filter "*.doc"

    $results = @{};

    $wa = New-Object -ComObject Word.Application

    $wa.Visible = $false $files | % {

        $filePath = $_.FullName

        $wd = $wa.Documents.Add($filePath)

        Write-Host "Loading $filePath..."

        $results[$filePath] = $wd.TrackRevisions

    }

    $wa.Quit()

    $wa = $null

    $results | ft -AutoSize

}

שלח תגובה

(שדה חובה)  

(שדה חובה)  

(אופציונלי)

(שדה חובה) 

Please add 1 and 5 and type the answer here:


Enter the numbers above: