Notepad++ corrupts Word files after successfully finding/replacing text string

  • Title says it all. After performing and replacing a string text in multiple files within the same directory, all of the files are corrupted and unable to open. I have attempted this four separate occasions. I am working on a Windows 7 machine with Word 2016. I do see in the open dialogue box that it found and replaced the text I am searching on, however not able to open the file after running Notepad++.

  • @willthatcher ,

    If by “Word files” you mean Microsoft Word documents, like .docx or .doc: they are a proprietary word processing binary format, and not a plain-text file. Notepad++ is a plaintext editor. There may be some visible words among the binary gobbledygook if you look at a .docx/.doc in Notepad++… but by changing the plaintext portions, you are likely changing string lengths, and binary formats don’t like it when you arbitrarily change string lengths.

    See more at

  • Yes, that is the issue, working in MS Word.

  • I always love the “title says it all” thing. Because no it doesn’t. If it did, the title would have been “Here comes another silly posting about someone attempting to edit non-text files with a text editor, and the person is totally clueless about why they are having problems doing this”. Ok, that title may be a bit longish…

    The second posting by the OP extends the cluelessness.

  • I wasn’t sure, given @willthatcher’s reply of

    Yes, that is the issue, working in MS Word.

    … whether that meant “oh, I understand now, IO shouldn’t be using Notepad++, a plain text editor, to edit the binary-encoded text in a word-processor document like a MS Word .doc/.docx”; or whether that meant, “yes, you have described my problem; I want to be able to edit a word document in Notepad++, and have completely ignored the link where you described why I cannot”.

    I gave the OP the benefit of the doubt, chosing to interpret it as the first, in which case nothing further was needed from me.

  • @willthatcher The simple answer is that you need to use Word if you are going to make changes to Word documents. The not so simple answer is not so simple, so I’ll omit it. :-)

  • @Jim-Dailey

    you’ve just made my day, with style ;-)

Log in to reply