Dominik Springer 2 years ago
parent
commit
5f9be46256
2 changed files with 21 additions and 0 deletions
  1. 5 0
      microsoft/ms-office/auto-correction.csv
  2. 16 0
      microsoft/ms-office/auto-correction.ps1

+ 5 - 0
microsoft/ms-office/auto-correction.csv

@@ -0,0 +1,5 @@
+"term","replacement"
+"Gerard","Gérard"
+"Tamas","Tamás"
+"Erno","Ernő"
+"pA","proALPHA"

+ 16 - 0
microsoft/ms-office/auto-correction.ps1

@@ -0,0 +1,16 @@
+# Sets auto-replacements for Microsoft Office
+
+# Get objects
+$word = New-Object -ComObject word.application
+$word.visible = $false
+$entries = $word.AutoCorrect.entries
+
+Import-Csv .\auto-correction.csv | ForEach-Object {
+    $entries.add($($_.term), $($_.replacement))
+}
+
+# Clean up
+$word.Quit()
+$word = $null
+[gc]::collect()
+[gc]::WaitForPendingFinalizers()