Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • WORDCONVERT: module to transfer files among several types in Windows

    wordconvert makes it easy to transfer files from rtf to docx. It also permits document files to be transferred between several different types in Windows. It is now available on SSC, with thanks to Kit Baum.

    We normally report regression tables with esttab, which can produce regression results to an RTF file.

    New features like putdocx in Stata 15 allows more flexible output to MS Word, it allows us to design the State of Art tables, but we cannot use esttab to report regression results directly to DOCX files. The wordconvert allows you to firstly report regression tables to an RFT, then transfer it into a DOCX. Then you can use putdocx to append this DOCX file to the DOCX files you designed with putdocx. For detail, please install and go to the help.

  • #2
    Hi Tony,

    This is excellent! It is exactly what I was looking for. However, after running the program and setting the execution policy to RemoteSigned and adding the powershell to environmental variables, the wordconvert Stata function is still not saving my .rtf file to a .docx file.

    Would you have any suggestions of what I may be doing incorrectly?

    Here is the excerpt of my code:

    esttab a b c d using "concurrent.rtf", substitute("\fonttbl{\f0\fnil Times New Roman" "\fonttbl{\f0\fnil Times New Roman" "\fs24" "\fs22" "\fs20" "\fs22" "\super " "" "\trowd" "\trowd\intbl\trautofit1") ///
    title("Dependent Variable: ") ///
    rename(institutionaltrust satdem trust satdem female satdem edu satdem 1.exp#c.institutionaltrust 1.exp#c.satdem ///
    1.exp#c.female 1.exp#c.satdem 1.exp#c.edu 1.exp#c.satdem 2.exp#c.institutionaltrust ///
    2.exp#c.satdem 2.exp#c.female 2.exp#c.satdem 2.exp#c.edu 2.exp#c.satdem ///
    1.exp#c.trust 1.exp#c.satdem 2.exp#c.trust 2.exp#c.satdem) ///
    order(1.exp 2.exp 1.exp#c.satdem 2.exp#c.satdem) ///
    ar2 l nogaps nonumbers nobase noomitted onecell replace se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) ///
    b(2) se(2)

    wordconvert "concurrent.rtf" "concurrent.docx", replace


    When running the code, a cmd window briefly appears with the error message:

    "C:\Users\lundmark\Box : The term 'C:\Users\lundmark\box' is not recognized as the name of a cmdlet, function, script, file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    C:\Users\lundmark\Box Sync\Analyses..."

    Last edited by Sebastian Lundmark; 24 Jul 2017, 19:23.

    Comment


    • #3
      Dear Sebastian, Sorry to reply you late coz i seldom comes to the forum. Let us check the code and reply you later.

      Another suggestion is to use reg2docx, which can report your regression results to docx directly

      Best

      Tony

      Comment


      • #4
        Hi Tony,

        Thanks for the reply! I have been checking what may be wrong, and from the error messages and google results I get it seems as if the script is not properly saved to my computer. It seem to interpret the spaces in the path directory as the end of the path (since my path should be "C:\Users\lundmark\Box Sync"). Do I need to download your script called wordconvert.ps1 and place in a specific directory for this function to work? Or is this as simple as the .ado file is using Mac's / instead of the windows \ for path directories?

        /Best Regards Sebastian Lundmark

        Comment


        • #5
          Sebastian Lundmark or Tony Li, are there any solutions available to handle spaces in the path directory?
          Last edited by Felix Kaysers; 30 Oct 2024, 04:43.
          __________________________________________________ __________

          Cheers, Felix
          Stata Version: MP 18.0
          OS: Windows 11

          Comment

          Working...
          X