VBA to create a file with utf-8 format
You can create any text or html file or any other file with utf-8 encryption.
- Dim TempFile As String
- TempFile = "TempFileName.html"
- Dim fsTrm As Object
- Set fsTrm = CreateObject("ADODB.Stream")
- With fsTrm
- .Type = 2 'Stream Type - we want Text Data.
- .Charset = "utf-8" 'Specify Character Set.
- .Open 'Open the Stream And write Binary data to the Object
- .WriteText "String"
- .SaveToFile TempFile, 2 'Save Binary Data to Disk (Overwrite)
- End With
Comments
Post a Comment