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) }


Posted

in

by

Tags:

Comments

2 responses to “Generating Word XML – and error”

  1. Ovi Avatar
    Ovi

    generate with??? oh the suspense is killing me

    1. Andrei Ignat Avatar
      Andrei Ignat

      You can generate with string template, razor or whatever.

Leave a Reply

Your email address will not be published. Required fields are marked *