Break ON
$strSrcFile = "C:\test\test-UDF-8.txt"
$strDstFile = "C:\test\test-ANSI.txt"
$strFind = "~"
$strReplace = ","
$objWord = CreateObject("Word.Application")
$RC = $objWord.Documents.Open($strSrcFile)
$objWord.Selection.Find.Text = $strFind
$objWord.Selection.Find.Replacement.Text = $strReplace
$objWord.Selection.Find.Forward = 1
$objWord.Selection.Find.Format = 0
$objWord.Selection.Find.MatchCase = 0
$objWord.Selection.Find.MatchWholeWord = 0
$objWord.Selection.Find.MatchWildcards = 0
$objWord.Selection.Find.MatchSoundsLike = 0
$objWord.Selection.Find.MatchAllWordForms = 0
$RC = $objWord.Selection.Find.Execute(Replace:=wdReplaceAll)
$RC = $objWord.ActiveDocument.SaveAs($strDstFile,2)
$RC = $objWord.Application.Quit