View Single Post
 
Old 03-31-2019, 07:59 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The command you are using appears to be correct. I suspect the tables it is failing on are already using that table style so the local overrides are not be wiped. What happens if you first move away from the preferred table style and then apply the right one?
Code:
Sub ApplyTableStyle()
  Dim t As Table
  For Each t In ActiveDocument.Tables
    t.Style = "Table Normal"
    t.Style = "Light Shading - Accent 3"
  Next
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote