View Single Post
 
Old 09-27-2023, 12:46 PM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Hi! I think you will find the answers here:
Style.NoSpaceBetweenParagraphsOfSameStyle Always Returning False?
and
NoSpaceBetweenParagraphsOfSameStyle

Using Graham Mayor's advice, I've slightly changed your code and it seems to work:

Sub NoSpaceBetweenPar()
Dim aRng As range, iType As Integer
Dim Para As Paragraph

On Error GoTo Leave 'if no footnotes
For iType = 1 To 2
Set aRng = ActiveDocument.StoryRanges(iType)
For Each Para In aRng.Paragraphs
Para.Style.NoSpaceBetweenParagraphsOfSameStyle = False
Next Para
Next iType
Leave:
End Sub
Reply With Quote