auto-correction.ps1 358 B

12345678910111213141516
  1. # Sets auto-replacements for Microsoft Office
  2. # Get objects
  3. $word = New-Object -ComObject word.application
  4. $word.visible = $false
  5. $entries = $word.AutoCorrect.entries
  6. Import-Csv .\auto-correction.csv | ForEach-Object {
  7. $entries.add($($_.term), $($_.replacement))
  8. }
  9. # Clean up
  10. $word.Quit()
  11. $word = $null
  12. [gc]::collect()
  13. [gc]::WaitForPendingFinalizers()