Line Andersen
Line Andersen

Reputation: 3

VBA code for "Don't add space between paragraphs of the same style" for footnotes in Word

I am interested in the "Don't add space between paragraphs of the same style" being checked as default when adding a new footnote in a document. So far I have this code:

Sub NoSpace()
    ActiveDocument.Styles("Footnote text") _
        .NoSpaceBetweenParagraphsOfSameStyle = True
End Sub

Which works okay, but only after adding a footnote and then running the code. I am interested it in working as a default, ie. when i open a document and add a footnote, I want the box to be checked. I hope someone can help me with this issue.

Upvotes: 0

Views: 541

Answers (2)

Line Andersen
Line Andersen

Reputation: 3

Thank you both very much! I worked when i changed the setting in the template.

Upvotes: 0

Timothy Rylatt
Timothy Rylatt

Reputation: 7850

If you want "Don't add space between paragraphs of the same style" set as a default then make sure that the template you use to create your documents has that set for the Footnote Text style. VBA code isn't required for this.

Upvotes: 1

Related Questions