View Single Post
 
Old 10-16-2023, 01:51 AM
RobiNew RobiNew is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Sep 2023
Posts: 200
RobiNew is on a distinguished road
Default

Hi Vivka! The code here below produces an error. Can you help? Thanks!



Code:
Sub EliminaSpazio()
'Text and Footnotes: Removes space before paragraph mark
'Qui per poi eliminare tutti i paragrafi vuoti.
Dim aRng As Range
Dim iType As Integer
Dim Para As Paragraph
    For iType = 1 To 2
Set aRng = ActiveDocument.StoryRanges(iType)
For Each Para In aRng.Paragraphs
If Para.Range.Characters.Last.Previous = " " Then 'ERROR
Para.Range.Characters.Last.Previous.Delete
End If
Next Para
    Next iType
Set aRng = Nothing
End Sub
Reply With Quote