In a Word document, there are sometimes extra blank paragraphs. A typical feature of such a blank paragraph is that it has only one hard return, and you can delete such a blank paragraph by deleting the hard returns by using "delete" when editing the document. In fact, by writing simple VBA code, you can quickly delete such blank paragraphs by judging all the paragraphs in your code, determining whether they are 1, or deleting the paragraph. Here's how to quickly remove a hard return from a paragraph in a word 2013 document.
1, Start Word 2013 and open the document you want to work with, and there are extra blank paragraphs in the document, as shown in Figure 1.
Figure 1 documents to be processed
2, press the "ALT+F11" key to open the Visual Basic Editor, in the Project Explorer pane, right-click the project you want to work with the document, select Insert | On the shortcut menu that opens Module command, as shown in Figure 2.
Figure 2 Selecting the module command
3, at this point will insert a module, the module in the Code window to enter the program code, as shown in Figure 3. The specific program code is as follows.
Figure 3 Entering program code in the Code window
Sub Del ()
Dim Temp as Paragraph
All temp in activedocument.paragraphs
If VBA. Len (temp. Range) =1 Then
Temp. Range.delete
The If
Modified Next
The End Sub
4, press "F5" key to execute this procedure, the blank paragraph in the document is deleted directly, as shown in Figure 4.
Figure 4 A blank paragraph in the document is deleted