View Single Post
 
Old 08-19-2023, 02:01 PM
vivka vivka is offline Windows 7 64bit Office 2016
Competent Performer
 
Join Date: Jul 2023
Posts: 228
vivka is on a distinguished road
Default

Italophile, thank you for clearing up the misunderstanding. My n-th try:
Code:
Sub Test_Nth()

Application.ScreenUpdating = False
'If the selection includes tables, error 4605 will be returned.
'Thus an error handler is needed:
On Error Resume Next
    For Each oPara In ActiveDocument.range.Paragraphs
        oPara.range.Select
        selection.End = selection.End - 1
        selection.Shading.BackgroundPatternColor = wdColorAutomatic
    Next oPara
Application.ScreenUpdating = True
End Sub
Reply With Quote