View Single Post
 
Old 08-16-2023, 02:40 PM
darkmaster006 darkmaster006 is offline Windows 10 Office 2021
Novice
 
Join Date: Aug 2023
Posts: 10
darkmaster006 is on a distinguished road
Default

Quote:
Originally Posted by vivka View Post
Hi! Back to my previous answer.
The both will work:

Code:
 
Sub Test() 
 
   selection.WholeStory
   selection.Shading.Texture = wdTextureNone
   selection.Shading.ForegroundPatternColor = wdColorAutomatic
   selection.Shading.BackgroundPatternColor = wdColorAutomatic
   selection.Collapse 1 'this deselects the text
 End Sub
Or:


Code:
Sub Test()

     With ActiveDocument.range
        .Shading.Texture = wdTextureNone
        .Shading.ForegroundPatternColor = wdColorAutomatic
        .Shading.BackgroundPatternColor = wdColorAutomatic
     End With
End Sub
Hello, thank you!
Sadly, it seems that this leaves it with a complete white background (can't figure out why):
Reply With Quote