Import text file
External files of text can now be added at any point in the current document using importfile(File_address.ext) command.
HTML documents
Personally, I often use this option if I have to convert a Stata do file into HTML format with syntax highlighting. Suppose I have a file
Fama_and_French.do
and I want to convert this whole file into an HTML page, I shall use the following code
asdocx, importfile(Fama_and_French.do) save(Myfile.html) replace
Word documents
When importing a text file into a word document, the file is imported without syntax highlighting. However, we can use the font option to set font for the imported text.
asdocx, importfile(My_importfile_name.txt) save(Myfile.docx) replace font(courier new)