VBA Word Macro for Adding a Blank Line after Each Verse in a List

February 4, 2024

Suppose you have used some kind of Bible software to export the text of a list of verses to a Word document. For some reason, the verses end up without a blank line in between them, and you would like to have a blank line in between all the verses.

The following macro adds a blank line after each verse in the Word document.

Sub BlankLineInsert()

‘Selects the whole document
Selection.WholeStory

‘Provides the total number of paragraphs
pp = Selection.Paragraphs.Count

‘Loops through the paragraphs and adds a line after each verse except the last verse

For i = 1 To pp * 2 – 2

‘Selects each paragraph
ActiveDocument.Paragraphs(i).Range.Select

‘Goes to the end of that paragraph
Selection.MoveRight Unit:=wdCharacter, Count:=1

‘Adds a blank line
Selection.TypeParagraph

‘Increases the value of i by 1 to account for the extra line that has been added
i = i + 1

Next i

End Sub


Note: This macro also works for any other Word document that is only text for which you want to add a blank line after each paragraph in the document.

 

Copyright © 2011-2024 by Rajesh Gandhi. All rights reserved.

Rajesh

Posts

Copyright © 2011-2024 by Rajesh Gandhi. All rights reserved.