Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
VBAマクロ向け関数。指定したパスに、変数の内容を、UTF-8のテキストファイルで書き出す関数。Microsoft JET 2.8以上必須です。
' 引数1:書き出し先のフルパス
' 引数2:流し込みたい文字列が入った文字列変数
'Option Explicit必須、Microsoft JET2.8以上必須
Private Sub WriteUnicodePlainText(ByVal strFN As String, ByVal strTEXT As String)
Dim adodbStream As ADODB.Stream
Set adodbStream = New ADODB.Stream
adodbStream.Type = adTypeText
adodbStream.Charset = "UTF-8"
adodbStream.WriteText strTEXT
adodbStream.SaveToFile (strFN), adSaveCreateOverWrite
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.