23

As you can see in the following screencast, I copy some text from a Microsoft Word document. When I paste it into the editor, it is as if I had clicked on the "image" button:

Enter image description here


Steps to reproduce

  1. Create a blank document in Microsoft Word for Mac 16.25 on OS X v10.12.6 (Sierra)
  2. Type the string "foo"
  3. Select all text and copy it
  4. With Chrome 76, go to Stack Overflow and create either a question or an answer
  5. In the editor, paste with cmdv

The editor should now display the file attachment modal.

12
  • 4
    That's word inserting an object on the clipboard. Try to paste that to libreoffice calc.
    – Braiam
    Mar 29, 2019 at 0:06
  • 2
    Cross-site post on Meta.SE: Can't paste data to question, get prompted for Image?. Happens for Excel as well. Mar 29, 2019 at 0:07
  • 1
    BTW, the only workaround I know of is to not use MS Office.
    – Braiam
    Mar 29, 2019 at 0:17
  • 4
    @Braiam I’m sure copy-pasting the content from MS Office to a text editor like Notepad, then copy-pasting that to the Stack Overflow editor works just fine. Mar 29, 2019 at 0:18
  • I understand that MS Word wraps the text into some form of container that appears like a binary format to the SE editor. However when I copy/paste that same thing into my IDE, it does manage to extract only the text. So somehow it must be possible to do that, the question is whether the SE editor can do the same thing. If it can, is this a bug, a regression or just expected behaviour? Mar 29, 2019 at 0:20
  • 1
    @customcommander Does your IDE accept image uploads? If not, then it’s not surprise that it works fine. The clipboard can store multiple chunks of data associated with different MIME types. Word and Excel happen to provide at least a text/plain version of the data and some image/* one. Apr 1, 2019 at 7:01
  • 1
    @customcommander I am unable to repro this copying text or tables from Word. I can repro it copying from Excel. Can you please give me more details on how to repro this from Word (either here or by email)? Sep 5, 2019 at 7:38
  • @YaakovEllis Thanks for looking into this. I can still reproduce this; I edited my post to include the steps to reproduce. Sep 5, 2019 at 13:58
  • 1
    @customcommander thanks. no repro on windows, so I am assuming it is something specific to word for mac. Sep 5, 2019 at 14:04
  • 6
    We are not going to be working on a fix for this at the time being. Seems that it is only happening with Word for Mac. And there is a good workaround in place as well (see the accepted answer below). So given that, and the other things in our pipeline, this is going to be a status-declined. Sorry. Sep 11, 2019 at 17:54
  • @YaakovEllis Fair enough ;) Sep 16, 2019 at 16:39
  • 1
    I just got here from MSE, where a related post on OneNote was. I can't repro this using FF, I can repro using Chrome...
    – Luuklag
    Sep 27, 2019 at 11:43

2 Answers 2

24

You can press Ctrl+Shift+V to paste as plain text. I believe Chrome and Firefox support this key combination.

18

The clipboard can store multiple representations/formats of the same object.

Text is the lowest-common-denominator representation, but that's the only representation that your text editor supports, so that's what it gets. The Stack Exchange editor supports images, so when the clipboard offers that format, it accepts it.

Why are images preferred over text for paste destinations that support both? Because images are, in general, higher fidelity: they retain more of the original character of the copied object. The goal of the clipboard is to transfer the best possible representation of the original object.

The workaround is to copy the object in Microsoft Word as plain text. Then, it won't try to retain any formatting from the original, and shouldn't place an image representation on the clipboard.

I doubt this is a common problem. Do you often write code in Word?

7
  • Thanks for the clarification. I don’t write code in Word but code sample can come from Word. When required to cite, this may also come from a bibliography in Word. I agree this doesn’t seem like a common problem though Mar 29, 2019 at 1:06
  • 4
    Jon Skeet codes in Microsoft Paint. Not even Word.
    – iBug
    Mar 30, 2019 at 6:14
  • @iBug No, Jon Skeet wouldn't stoop to some GUI. Clearly, he programs working with the encoded bits directly. Whether he uses magnets to modify the drive directly or uses a slightly higher level interface is an open question, though.
    – jpmc26
    Mar 30, 2019 at 6:35
  • @jpmc26 3rd dot of this answer
    – iBug
    Mar 30, 2019 at 6:51
  • 2
    Amateurs. The real way to write code is to knit it. Mar 30, 2019 at 12:25
  • 1
    @CodyGray Or weave it. Apr 4, 2019 at 19:41
  • How do you copy as plain text? My bug database is in Word, so pasting answers I found happens a lot.
    – Noumenon
    Jan 15 at 4:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .