Announcement

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

  • Fail to copy and paste .gph graphs from Stata 15 to Word

    Dear Forum Members,

    Recently, after creating .gph graphs in Stata, I realize I cannot just copy it and paste in MS Word, as I usually did under Stata 14.2.

    Whenever I click on "Copy" - also, using the right-click with the mouse, or typing Control C - and try to paste the graph in Word, there is no image in Word.

    That said, if I "save as" .png, for example, I can copy and paste it correctly.

    I wonder whether it is a bug.

    By reading this message, it seems the problem happened with Stata 14, some time before.

    I'm using Stata 15 under Windows 10 "Creators".

    I update Stata on a weekly basis, and I did it today, to no avail.

    Thank you in advance.
    Best regards,

    Marcos

  • #2
    I'm using Windows 10 Pro version 1703 (aka Creators Update) and had no problem pasting a graph from Stata 15 to Microsoft Word 2016.

    https://www.dropbox.com/s/gxtuk00l90...d2016.mov?dl=0

    The message you're referring to was for Stata 14 for Mac and was specific to the Mac.
    -Chinh Nguyen

    Comment


    • #3
      Originally posted by Marcos Almeida View Post
      Whenever I click on "Copy" - also, using the right-click with the mouse, or typing Control C - and try to paste the graph in Word, there is no image in Word.
      I can copy and paste a graph to Word but observed the following:
      • At the moment the graph is copied (either with Ctrl+C or by clicking on "Copy"), Stata appears to redraw the graph.
      • The graph copied to Word is not antialiased and it has a white border that is not present in Stata.

      Comment


      • #4
        Thank you for the feed back, Friedrich and Chinh.

        I turned off the laptop, turned it on again, and I got the same result: no image at all.

        By the way, I'm using MS Word 2016 as well. The Dell laptop has Intel Core i7(7th gen).

        What puzzles me is the very fact that it is a "regular" task that I did (well) so far. Besides that, everything works fine in both Stata and MS Word.

        To curb the issue, I'm "saving as" .png, and that works properly, I mean, copy and paste without problem.

        I wonder whether someone is experiencing a similar trouble, or other "error" messages related to a similar issue: to copy .gph and paste it in MS Word.
        Best regards,

        Marcos

        Comment


        • #5
          Please post your .gph files so I can try opening it in Stata and copying it to Word. Also, try a simple scatter plot and verify whether it'll paste into Word. The graph from the video I posted was created using the command:

          Code:
          gr_example uslifeexp2: scatter le year, c(l) m(i)

          • The graph copied to Word is not antialiased and it has a white border that is not present in Stata.
          The graph not appearing antialiased in Word is a function of how Word renders the image. If you save the document as a PDF file and open it in a PDF viewer like Adobe Acrobat, you'll see an antialiased graph. If you edit the picture in Microsoft Word, the graph will then appear antialiased but then for some reason, Word botches the rotated text.
          -Chinh Nguyen

          Comment


          • #6
            Chinh Nguyen (StataCorp)
            Please post your .gph files so I can try opening it in Stata and copying it to Word. Also, try a simple scatter plot and verify whether it'll paste into Word.
            Indeed, I tested with simple plots, and got the same results.

            For example:

            Code:
            .  sysuse auto
            . scatter mpg price
            Graph_no_paste.gph

            By the way, I still can copy graphs directtly from every other source an paste them in Word, such as .png (even after "saving as" in Stata), but also plots from other statistical packages, such as R as well as SPSS.

            It seems the issue is related to .gph, when copying and pasting in MS Word.

            Hopefully you reproduce the problem and find a solution.

            Thanks again in advance.
            Best regards,

            Marcos

            Comment


            • #7
              I had no problem here with that .gph file:

              https://www.dropbox.com/s/3nh6gjn374...asted.mov?dl=0

              Can you save the graph as an EMF file and import that? Also try changing the Clipboard format to WMF in the graph preferences. EMF is preferred but let's see if WMF works.

              If you're still having problems, you should contact technical support directly.
              Last edited by Chinh Nguyen (StataCorp); 25 Jul 2017, 07:55.
              -Chinh Nguyen

              Comment


              • #8
                Chinh Nguyen (StataCorp) : I followed your suggestion and I wish to share it here. I changed the clipboard format to WMF and now I can copy and paste .gph graphs from Stata to MS Word. Thank you very much for the very useful reply.
                Best regards,

                Marcos

                Comment


                • #9
                  Originally posted by Marcos Almeida View Post
                  Chinh Nguyen (StataCorp) : I followed your suggestion and I wish to share it here. I changed the clipboard format to WMF and now I can copy and paste .gph graphs from Stata to MS Word. Thank you very much for the very useful reply.
                  You shouldn't have to do that and WMF does not support transparency. Please contact technical support as we can provide more debugging information that's beyond the scope of this forum.
                  -Chinh Nguyen

                  Comment


                  • #10
                    Thank you for the information. I'll contact the technical support.
                    Best regards,

                    Marcos

                    Comment


                    • #11
                      I, too, am unable to copy and paste from Stata 14.2 into Word. This problem is new. I have always been able to do so. If this is a bug, it would be from one of the recent updates. It seems to me that the drop down menu option in the graph window used to include the "Copy Graph" option either under "Edit" or "Object". Now there is only a "Copy" option under "Edit" and it fails to copy. The graph blinks when I select that option, and then there is nothing there when I try to paste it into Word. Any new insights into this would be much appreciated.

                      Comment


                      • #12
                        I still have this problem, and I agree with you: it must be related to a 'problem' with the up-dated version.

                        I have it with Stata 15, but I didn't have with Stata 14. Recently, a couple of days ago, out of curiosity, I updated it and, lo and behold, the problem started to happen with this version as well.

                        Among the (hopefully, provisory) solutions you may save as png, then copy to Word, or you may change the preferences, acoording to a message you see from the StataCorp, above.

                        All in all, let''s hope a solution by StataCorp will be found in due time.

                        Meanwhile, shall somebody else experience this same problem, please share the information as well.
                        Best regards,

                        Marcos

                        Comment


                        • #13
                          I just made a scatterplot in Stata version 14.2, copied it to the clipboard and pasted it in MSWord without any problem. My Stata clipboard preferences are set to EMF.
                          I have Microsoft Office Professional Plus 2016

                          Comment


                          • #14
                            I too appear to have no problems when I try the following in both Stata 14.2 and Stata 15.0 (MP-4, Windows 7 Professional, 64 bit), both fully updated, together with MS Word from MS Office Professional Plus 2013.

                            In Stata:
                            Code:
                            sysuse auto
                            scatter mpg price
                            followed by copy of the resulting graph to clipboard and paste directly into the MS Word document. My Stata graphics clipboard preferences are set to the default, i.e. EMF.

                            Good luck in the detective work, Marcos!

                            Comment


                            • #15
                              Thank you for sharing information, Stephen and Eric.

                              I wonder whether it relates to a particular hardware, say, laptop (as in my case) or producer (Dell, in my case).

                              The fact is: I can copy from R, SPSS, etc. and paste in Word without problems. Also, I can take the .gph and "save as" .png, then copy and paste without problems. Finally, shall I change to WMF, copying and pasting from Stata in Word will work perfect.

                              I wonder whether a recent update didn't "crashed" with Dell's updates, specifically in terms of the sort of .gph graph.

                              Apart from that, everything seems to work fine with my computer. To curb the issue so far, I'm just saving in .png.

                              Best regards,

                              Marcos

                              Comment

                              Working...
                              X