Set eucStream = New ADODB.Stream
eucStream.Open
eucStream.Type = adTypeText
eucStream.Charset = "ASCII"
eucStream.WriteText String(20, 0)
'先頭4文字(8バイト)をEUC文字列で上書き
eucStream.Position = 0
eucStream.Charset = "EUC"
eucStream.WriteText "这是EUC编码的文件"
'保存
eucStream.SaveToFile "C:\sample.txt", adSaveCreateOverWrite
上述代码需要 ADO 2.5(或以上版本)支持。