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

  • putdocx image

    Hi Statalist,

    I'm producing a .doc file using Sata15:
    putdocx clear
    putdocx begin
    putdocx paragraph
    putdocx image U:\NDRLS stats webpage\2017\graphs\NDRL-Fig2-Facility-Registrations-by-Facility-Type-and-Year.png , link
    putdocx save "U:\NDRLS stats webpage\2017\NDRLS stats webpage-stata15", replace
    Everything is fine on my laptop. However, when I opened the .doc file on computers without Stata15 I got "The picture can't displayed" error message.

    I made another .doc file without "link" option and it worked.

    I'm wondering if there is any solution for displaying graphs on computers which do not have Stata when the link option was used?

    Last edited by Masoumeh Sanagou; 13 Aug 2017, 18:07.

  • #2
    The link option inserts a linked image. If the other computer can't find this image, Word won't be able to load the image, even if Stata is installed. To test this, move or rename the .png file on your computer and open the Word document. You should get the same error.

    If you want the linked image to show on any other computer, it needs to be in a location that both computers can access such as a network drive.


    • #3
      Thanks for the reply. So I will make two .doc files, one with "link" for myself and one without link for my supervisor.


      • #4
        Dear Statalist,

        I'm using Stata 15. I try to embed output to docx using putdocx.
        The output command as bellow:

        . table var1 var2, matcell(M)

        I try the code find on the forum:

        tab Tuyến Năm, col nokey matcell(M)
        putdocx table my_table = matrix(M)
        putdocx save myreport.docx, replace

        but the emded table on the docx have no rowname and column name, as bellow:

        Thank anyone that may help to export full table to docx.