Pandu
Pandu

Reputation: 159

How to save as text file as UTF-8 encoding from word doc using VBA?

I have created a VBA macros for html conversion. After the conversion process, the word document should save as ".txt" file with UTF-8 encoding in the same path and same file name, when i click the command button.

Is it possible to make it?

Upvotes: 3

Views: 4313

Answers (1)

Phylogenesis
Phylogenesis

Reputation: 7880

You need to pass the appropriate parameters to the SaveAs method:

ActiveDocument.SaveAs _
    FileName:="C:\My\Path\Textfile.txt", _
    FileFormat:=wdFormatText, _
    Encoding:=65001

Upvotes: 2

Related Questions