View Single Post
 
Old 04-02-2019, 04:25 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,164
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

In that case, you must also have other shapes in your document that don't contain text frames. Try this klunky version to handle that
Code:
Sub ApplyTableStyle()
  Dim t As Table, aShp As Shape
  For Each t In ActiveDocument.Tables
    t.Style = "Light Shading - Accent 3"
  Next
  On Error GoTo JumpJump
  For Each aShp In ActiveDocument.Shapes
    For Each t In aShp.TextFrame.TextRange.Tables
      t.Style = "Light Shading - Accent 3"
    Next t
JumpJump:
    Err.Clear
  Next aShp
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote