Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2023, 02:37 AM
vivka vivka is offline Change "fill" text colour to no colour Windows 7 64bit Change "fill" text colour to no colour Office 2016
Expert
 
Join Date: Jul 2023
Posts: 305
vivka is on a distinguished road
Default

Hi again! Unfortunaltely, from the very beginning it was not clear that the document had a page filling color. After the misunderstanding has been corrected, here's the code that seems to work:



Code:
Sub Deshading()

Dim oPara As Paragraph
'If the selection includes tables, error 4605 will be returned.
'Thus, an error handler is needed:
On Error Resume Next

Application.ScreenUpdating = False
    For Each oPara In ActiveDocument.range.Paragraphs
        oPara.range.Select
        If Not selection.Shading.BackgroundPatternColor = wdColorAutomatic Then
            selection.Shading.BackgroundPatternColor = wdColorAutomatic
        End If
    Next oPara
Application.ScreenUpdating = True
End Sub

Last edited by vivka; 08-17-2023 at 09:53 PM.
Reply With Quote
Reply

Tags
fill, shading



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Text Colour/Box Shade if CheckBox is marked cavals07 Word VBA 7 01-30-2023 11:05 AM
Change "fill" text colour to no colour New table line has some cells fill colour change trevorc Excel 2 06-30-2021 12:27 PM
Text box fill colour changes when pasted to new file ParishPete Publisher 0 06-21-2019 12:47 AM
Change text colour for content control labels? Toe Word 1 01-17-2019 08:45 AM
How to globally change default "pattern fill" color for all shapes in PP 2013 tbach PowerPoint 1 01-31-2014 10:59 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft