6

Sometimes, I use MS Word to draft content in Markdown, due to autosave and other helpful features. The syntax for a link is to have the readable text in square brackets immediately followed by the URL in parentheses, like this: [Super User](http://superuser.com). Commonly, I copy the URL from a browser, and go to paste it into the draft.

If I paste in Notepad, or most places in the Word document, the first characters (http...) begin immediately where the cursor was when I hit paste.

However, if I'm in Word with the cursor immediately after a ]( sequence, Word adds a space before the URL, breaking the markdown link (depending on parser strictness). It also does this if pasting text from elsewhere even in the same document, with no leading space.

How do I stop Word from doing this?

(Edition: Office 365 ProPlus, macros disabled).


Per comments from @fixit: After a paste in Word, I copied the )[ through the pasted content and pasted it in cell A1 of an Excel spreadsheet. In A2, I put the formula =RIGHT(A1,LEN(A1)-1) (equivalent to substring(1) in some other programming languages) and dragged that formula down several columns, with each row's A cell showing the same as the previous row minus the first character.

In the next column (B1) I used the formula =CODE(A1) which shows the character code for the first character in the string.

Where that space character is first (A3), the code (B3) is 32. As this is on a Windows machine, that's the ANSI character set, for which values 0-127 match ASCII, and character 32 is a space. Therefore, the character in question is a space, not some nonprintable character that Notepad ignores and Word shows as a space. Additionally, if such a character were part of the copied string, it would show up when pasted after other characters, such as ( when it is not immediately preceded by ]. However, in such cases, no space is added.

2
  • There's no reason why it should do that. I'm wondering if, at some point, you did such a paste and Word is now auto-correcting it for you, or something similar. Another thought, your URL copy action might be including some unexpected character. Notepad doesn't deal with it because it's a non-print character, but Word displays it as a space. It might be worth experimenting with how you select the string to copy. e.g., start the selection past the first character, paste, and see if you still get the space. (cont'd)
    – fixer1234
    Commented May 1, 2019 at 20:01
  • Also, copy the Word string with the extra space and put it into Excel. Use Excel's text functions to determine exactly what character that space is.
    – fixer1234
    Commented May 1, 2019 at 20:01

1 Answer 1

10

The Adjust sentence and word spacing automatically setting is getting in the way of your desired behavior.

It's several layers deep within the Options menu structure.

File > Options > Advanced > Cut, Copy and Paste > Smart Cut and Paste > Settings. Clear the "Adjust sentence and word spacing automatically" option.

4
  • 1
    Any idea where that is in Microsoft Word Online (part of Office 365)? Commented Jan 8, 2023 at 10:33
  • 1
    @OlivierCailloux, I don't know. It's in the same place for me with "Microsoft 365 Apps for Enterprise". I don't know how Microsoft Word Online might differ.
    – Doug Deden
    Commented Jan 9, 2023 at 19:27
  • 2
    Thanks. This thread suggests that what I am looking for simply does not exist, unfortunately. Commented Jan 11, 2023 at 9:55
  • 1
    For Outlook 2016, this is at File > Options > Mail > Spelling and Autocorrect... > Advanced > Cut, copy, and paste > Use smart cut and paste (Settings) > Adjust sentence and word spacing automatically
    – IronEagle
    Commented Jun 20, 2023 at 13:27

You must log in to answer this question.

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