2

In Microsoft Word 2013 on Windows 7, I keep encountering a strange paragraph mark that cannot be copy-pasted properly, which causes all kinds of problems. Unfortunately, I do not know how to produce this mystery paragraph mark, but here is a file that contains it: Mystery paragraph mark that cannot be copied.docx.zip (a DOCX file zipped again for greater accuracy).

The mystery paragraph mark shows up as a normal pilcrow (¶) when I make Microsoft Word display all non-printing characters – exactly like regular paragraph marks. However, it behaves oddly:

  • When I select the entire text and copy-paste it to, say, the Notepad, then it is replaced by a plain space character.
  • The mystery paragraph mark can occur in DOCX or DOC files. When I save the file as RTF and reopen it with MS Word, then I get a space character instead. When I save the file as TXT, it is converted into a normal newline.
  • When I use MS Word's Replace dialog for replacing all paragraph marks ("^p") by something else, then the mystery paragraph marks will not be replaced. In this way, they resemble the mandatory paragraph mark at the end of any MS Word file.
  • When I open the file with other applications, most will convert the mystery paragraph mark into nothing at all; e.g., Apple's TextEdit.app or the old Microsoft Office Word Viewer:

    TextEdit screenshot

    But some will convert it into a normal newline; e.g. LibreOffice:

    LibreOffice screenshot

What is this mystery paragraph mark? How can I prevent it?

  • Could you please upload your .DOC, .RTF, and .TXT file? Everything seems to be working fine on my end and off the top of my head, it would seem that perhaps you entered a Unix style line break and MS Office is not converting it properly, even though it should. – Blerg Jul 14 '16 at 19:10
  • On what application and OS does it work fine for you? For now, I can only upload screenshots of how the mystery paragraph mark is interpreted differently on TextEdit and on LibreOffice. I only have access to MS Word at the office, so I cannot convert the files until I get back there. – mach Jul 14 '16 at 19:45
  • A section break that is set to 'continuous'? – Aganju Jul 14 '16 at 19:46
  • To get rid of it - What happens when you click the mouse next to it and press delete or backspace? – Clayton Jul 14 '16 at 19:54
  • Sorry, I over looked the part where you were stated that other programs copy it correctly. I installed 2013 and I'm looking at it. I can see what you're talking about now. – Blerg Jul 14 '16 at 21:05
4

Looking at your sample .docx, the "mystery paragraph mark" is represented by a <w:cr/> element, which is described in the ISO OOXML standard (e.g. ISO29500-2012 Part 1) in section 17.3.3.4 as cr(Carriage Return).

The summary description in there is "The behavior of a carriage return in run content shall be identical to a break character with null type and clear attributes, which shall end the current line and find the next available line on which to continue."

In other words, it is supposed to behave like a hard line feed (and in fact you do not get the normal paragraph spacing after such a mark), but Word evidently displays it in the same way as a paragraph mark. Normally, paragraph marks would be displayed at the end of a (Paragraph) element, and perhaps in some other cases.

One question is how you get a <w:cr/> into your document. I expect there are several ways, but one way you can certainly do it is to use Find/Replace to replace a character by "^13" (with the wildcard option unchecked).

Getting rid of them is not straightforward, because if you try to replace ^13 by something, Word replaces all the paragraph marks. If you copy/paste a mystery paragraph mark into the "Find What" box, Word replaces all spaces. Even in VBA it seems that they appear as "13" characters that are not easy to distinguish from normal paragraph mark characters.

However, as a really crude first shot at a solution, the following VBA appears to work in recent versions of Windows Word:

Sub replaceCRinDocBody
' Replaces paragraph marks that correspond to <w:cr/> Elements 
' by a normal paragraph mark
' This only processes the document body, not headers/footers.
Dim l as Long
With ActiveDocument.Content.Characters
  For l = 1 to .Count
    If AscW(.Item(l)) = 13 Then
      If Instr(1,.Item.WordOpenXML,"<w:cr/>") > 0 Then
        .Item(l).Text = vbCr
      End If
    End If
  Next
End With
End Sub
  • Thanks a lot! For my purposes, it is sufficient to replace "^13" by "^p". I guess the Windows clipboard handles the mystery paragraph mark like formatting. An application that accepts formatted text from the clipboard may be able to interpret it as newline, while an application that only understands plain text will interpret it as a space. I wonder whether anything can be done in order to make an input form on a website interpret it as a newline. – mach Jul 15 '16 at 7:14
  • re. the clipboard, I looked at what Word puts on the clipboard when you Edit->Copy one of these mystery marks, and in most of the standard formats (CF_TEXT etc.) it seems to put a space (0x20) there. I don't know which formats NotePad looks for but I would guess CF_TEXT, CF_UNICODETEXT or CF_OEMTEXT, and they all have a space. So Notepad isn't even "interpreting" an 0x0a character as a space - it's just displaying what it finds. As for an input form on a website, I guess it all depends how the form is loading the text. – user181946 Jul 15 '16 at 9:53
  • So when I copy the mystery paragraph mark from a Word document and paste it into another Word document, Word probably uses a special clipboard format? Within Word, it can be copied successfully and the copy keeps the strange behaviour. – mach Jul 15 '16 at 11:14
  • Yes, Word must use a private format. It puts several formats on the clipboard-OTTOMH I do not know which one it uses by default but ISTR it is not obvious from the Norman's name. – user181946 Jul 15 '16 at 12:16
4

I believe that my hunch was correct, the problem characters you are seeing seem to be a *nix style of newline, (ASCII code: 0D) or the Apple version, (ASCII code: 0A), whereas Windows typically uses a combined newline coding, (ASCII codes: 0D 0A). I can recreate the issue by creating a text file and manually editing the hex values of the file to give me the *nix newlines. Opening up the text file in Word shows the newlines as expected and attempting to copy them into Notepad(++) will display them as spaces. I even copied them into the file you posted and saved it, closed Word, reopened it and tried to copy and paste the text, same results. Other programs that were written to be portable, (LibreOffice, OpenOffice, probably others), have the ability to use the different types of newline characters, which is most likely why they're not affected by this issue.

In order to get rid of them, you'll probably have to use either OpenOffice or LibreOffice and use a regex to find them; however they're not being saved as the hex value 0D, so I'm not sure what value you should use to find the characters with.

-2

The special character mark is the Paragraph Indentation Marker in Word. To remove it you would set your version of word to not show formatting. How you do this is:

1) Click the Microsoft Office Button Office button image , and then click Word Options.

2) Click Display.

3) Under Always show these formatting marks on the screen, clear the check boxes for any formatting marks that you do not want to show in your documents at all times.

MSDN Link for further if needed

https://support.office.com/en-us/article/Show-or-hide-formatting-marks-c0460106-19d3-4441-986c-b655bffe6be4

  • The problem is not that I am unfamiliar with the pilcrow sign. The problem is that some paragraph marks have a strange behaviour, while other behave normally. Both kinds are represented by the pilcrow sign when non-printing characters are displayed. I have changed the wording to make this more obvious. – mach Jul 14 '16 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.