Generating Word XML – and error

When you generate Word XML file ( with StringTemplate ) or another tool, and you miss some content, Word does not display the error – instead it puts on a specific folder. And it is troublesome to find that file between more files.

So I create this small powershell program to delete all files from that folder – minus the error file, because the word is keep opening:

$folder = [environment]::getfolderpath(“LocalApplicationData “)
$folder = $folder + “\Microsoft\Windows\Temporary Internet Files\Content.MSO”
get-childitem $folder -include *.log -recurse | foreach ($_) {remove-item $_.fullname} # it will not remove the word error file
get-childitem $folder -include *.log -recurse | foreach ($_) { [System.Diagnostics.Process]::Start($_.fullname) }