- Editors and writers
- Purpose: To replace commonly used phrases and words without needing to find and replace using MS Word's built-in function every time
- Automated replacement of words in British English to American English or vice-versa is useful through this
- Replacement of non-hyphenated words, use of en-dash or em-dash for certain commonly-used phrases is possible through this
- A new phrase should be of the form: {old word(s)}:{new word(s)}
- Note: There shouldn't be any space after the colon unless you want an extra space upon replacement
- All occurrences of the words will be replaced in the word doc
- Powershell script must be allowed to run as per execution policy
- Check that your policy is either RemoteSigned, AllSigned or Bypass
In case it is not, open Windows powershell using Run as Administrator and using
Get-ExecutionPolicy Set-ExecutionPolicy -ExecutionPolicy <your preferred policy>
- Check that your policy is either RemoteSigned, AllSigned or Bypass
In case it is not, open Windows powershell using Run as Administrator and using
- The doc file you want to modify must be closed before running findrep.exe
- Open findrep.ps1
- Find the line
and replace the path with path to your find.txt
$words=Get-Content C:\Users\DELL\Desktop\find.txt
$words=Get-Content <your path>\find.txt
- Now open Windows powershell and install the module ps2exe which will convert the findrep.ps1 to an .exe file
- After installing ps2exe, you can now invoke it to convert findrep.ps1 to .exe:
- Now double-click findrep.exe and you will be asked the file name in the cmd of the MS Word doc that you want to modify: Provide the path to the word document you want to modify
- Everytime changes are made to findrep.ps1 you will need to re-create the .exe file using ps2exe