Vitali Climenco
Vitali Climenco

Reputation: 1314

How can I iterate through table styles only?

I have a procedure that iterates through the styles available to a document:

Sub EnumerateStyles()
  For Each Style in ActiveDocument.Styles
    `some custom code`
  Next
End Sub

I do not need all the styles, and just those that are applicable to tables only. How can I programmatically filter the styles?

Thank you

Upvotes: 1

Views: 404

Answers (1)

Vitali Climenco
Vitali Climenco

Reputation: 1314

Doh, finally figured out:

Style has the Type property, for the styles applicable to tables it is wdStyleTypeTable.

Upvotes: 1

Related Questions