I Have a Ansi txt File
I need to save it as a Unicode File into a Script using and Ole Object
I Can open it, modify it and save it but i don't know how to change
the encoding
VB(A) Strings are Unicode naturally. If Word's object model doesn't provide a
direct SaveAs in this format, just write the file directly using binary i/o...
Public Function WriteFileU(ByVal FileName As String, ByVal Data As String) As
Boolean
Dim hFile As Long
Dim uData() As Byte
' Convert String data to Unicode bytes.
uData = Data
' Since this is binary, we need to delete existing crud.
On Error Resume Next
Kill FileName
' Okay, now we just spit out what was given.
On Error GoTo Hell
hFile = FreeFile
Open FileName For Binary As #hFile
Put #hFile, , uData
Close #hFile
Hell:
WriteFileU = Not CBool(Err.Number)
End Function