View Single Post
 
Old 08-19-2023, 06:22 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

This code replaces automatic shading with the page color set in your example document:
Code:
Sub Another_Go()
'
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 = -654246042
    Next oPara
Application.ScreenUpdating = True
End Sub
Reply With Quote